Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 7th, 2004, 09:24 PM
bugs007 bugs007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 bugs007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Filter by selection VBA runtime

Hi

Could someone please help

I wish to do a Filter by selection in a runtime application.

An example vba code would be most appreciated.

Thank you and Merry Christmas.

Reply With Quote
  #2  
Old December 8th, 2004, 01:40 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Hi bugs007,

Can you be a little more specific in what you are wanting to accomplish. The question is too generic to offer any sample code. Are you wanting to display a set of records or one record, are you wanting to open a form based on a filter, a report, run a query...you get the idea. And filter at runtime, how are you creating your filter, is this a value typed in a text box, or a value from a table using a lookup or from items selected on a form....really need alot more information and try to be specific to exactly what you want, along with table names, field names, form names etc. so sample code can be as specific as possible.

lwells

Reply With Quote
  #3  
Old December 8th, 2004, 01:53 AM
bugs007 bugs007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 bugs007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

Thanks for your prompt reply.

I have just a single form with several bound text boxes displayed.

I wish to be able to click into one of the text boxes and then click a button and have the filter applied to the recordset based on the field clicked into AND the data it contains. Basically I wish to create a button which does exactly the same thing as the filter by selection option in Access. This option is not available on the menus in the runtime version.

Thanks and look forward to your reply.

Reply With Quote
  #4  
Old December 8th, 2004, 02:04 AM
bugs007 bugs007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 bugs007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If it helps to clarify this is how far ive got:


Private Sub Command92_Click()

Form.Filter = (FieldThatHasCurrentFocus=FieldThatHasCurrentFocus Contents)

Me.FilterOn = True
End Sub


I just need the correct code for FieldThatHasCurrentFocus=FieldThatHasCurrentFocusC ontents

Thanks

Reply With Quote
  #5  
Old December 8th, 2004, 05:26 AM
bugs007 bugs007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 bugs007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem solved everyone.


I got around it by creating a custom toolbar with the filter by selection icon in it, and a docmd.showtoolbar on form open event.

Thanks to all and Merry Christmas.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Filter by selection VBA runtime


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT