Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter form 1

Status
Not open for further replies.

jazminecat23

Programmer
Mar 16, 2007
103
US
Hi all - I have a form I'm trying to filter. Seems simple, right? Here's my code:

Code:
Private Sub Form_Load()

Me.Filter = Not VENDOR_NUM = 0
Me.FilterOn = True

End Sub

and every time, it throws me an error. "one or more operators in the filter is invalid."

*sigh*

All I want is to show the items where the vendor number is not 0. I am using the query on which this form is based elsewhere, so I would prefer not to change the query.

Can anyone help me? I would search, but it appears searching is still down.

thanks!
 
Me.Filter = "VENDOR_NUM<>0"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok, I changed it to that. after sayind duh to myself. but now, you're not going to believe this, I am getting runtime error 2021, "one or more operators in the filter expression is invalid" and it's highlighting

Me.FilterOn = True

what the? how can this be?

(banging head on nearest available solid object)
 
What is YOUR actual code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Now, it is:

Private Sub Form_Load()

Me.Filter = VENDOR_NUM <> 0
[red]Me.FilterOn = True[/red]

End Sub

and it's the second line that throws the error.
 
Please, reread carefully my previous suggestion ...
Me.Filter = [!]"[/!]VENDOR_NUM<>0[!]"[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
oh man, you are SO my hero today! I can't believe I got stuck on something that doubtless is obvious, but it's been a rough week. Thank you so much for your help - the quotes there did the trick. I really appreciate it, and hope you have a great weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top