using variable in Filter property (in code) (1 Viewer)

abo fahad

New member
Local time
Today, 16:07
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.
 

micks55

Registered User.
Local time
Today, 14:07
Joined
Mar 20, 2006
Messages
110
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
 

abo fahad

New member
Local time
Today, 16:07
Joined
Mar 28, 2006
Messages
5
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

Top Bottom