Mulitiple Filters on a Form (Using VBA)

Benjamin Bolduc

Registered User.
Local time
Today, 12:23
Joined
Jan 4, 2002
Messages
169
Im trying to set up some filters on a form Im creating. I created one using VBA in an option group and it works perfectly, but then when I try to make the other one I get "Enter Parameter" and "Run 2001" Errors. I can't understand how one works and the other doesnt.
Here is the Working one's code:

If Packoptions = 1 Then
Me.Filter = "Line='Vinegar'"
Me.FilterOn = True
End If (etc...)

And here is the one that I cant get to work:

If caseoptions = 1 Then
Me.Filter = "Pnumber = '4'"
Me.FilterOn = True
End If (Etc...)

This one is filtering by a number instead of a word, maybe that has something to do with it. If anyone has any suggestions, they would be very much appreciated, thank youi
smile.gif
 
As it is a number remove the single quotes around the number. Single quotes are used for strings.

HTH
 
Ok I took the single quote out so it looks like this now:

If caseoptions = 1 Then
Me.Filter = "Pnumber = 4"
Me.FilterOn = True
End If

And it still doesnt work
frown.gif

Any other suggestions?
 

Users who are viewing this thread

Back
Top Bottom