using variable in Filter property (in code)

abo fahad

New member
Local time
Today, 09:03
Joined
Mar 28, 2006
Messages
5
Hi.

Me.Filter = "Country = 'USA'"
Me.FilterOn = True

can i use a variable instead of the text 'USA'

give me an example if any pls.

thanks for help.
 
Hi, How about trying...

Me.Filter = "Country = " & myCombo
'or
Me.Filter = "Country = " & myControl
' either would go in the afterupdate event of the controls
' you still need to turn the filter on with
Me.FilterOn = True
'follow with
Me.Refresh
'or
Me.Requery

Mike
 
thanks alot Mike for help
your code dosen't work
i found another code , it works good
the code is
Me.Filter = "Country = '" & strCountry & "'"
thanks again Mike
 

Users who are viewing this thread

Back
Top Bottom