how to apply filter by selection option thru code in MS Access

G

gnana

We can use filter by selection by selecting appropriate button. but it should
be achievable by using code once particular text box got focus. how to do
this.
 
V

Van T. Dinh

If you want to use a CommandButton, use the following code in the Click
Event:

Screen.PreviousControl.SetFocus
' You need this since the CommandButton now has the Focus and
' and you need to send the Focus back to the TextBox
DoCmd.RunCommand acCmdFilterBySelection
 
Top