|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Filter by selection VBA runtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|