Not in List syntax error

G

Guest

I have code in the Not In List event to open a form to add a name. All that
is fine but when I close the form I get this error message "Syntax error
(missing operator) in query expression 'Vendor Name = "Master Fabricators'".
The following line is highlighted.

If Not IsNull(DLookup("VendorID", "tblVendors", "Vendor Name = """ & _
NewData & """")) Then

I'm unable to spot anything different from another instance where all works.
Can someone tell me what I'm missing?
Thanks
 
G

George Nicholson

Since your field name includes a space, you should enclose it in brackets:
[Vendor Name]

My guess is that isn't an issue in the 'other instance where it all
works' -and a good reason to never let spaces creep into field names :)

HTH,
 
G

Guest

Thanks for your help!

George Nicholson said:
Since your field name includes a space, you should enclose it in brackets:
[Vendor Name]

My guess is that isn't an issue in the 'other instance where it all
works' -and a good reason to never let spaces creep into field names :)

HTH,



Loni - RWT said:
I have code in the Not In List event to open a form to add a name. All
that
is fine but when I close the form I get this error message "Syntax error
(missing operator) in query expression 'Vendor Name = "Master
Fabricators'".
The following line is highlighted.

If Not IsNull(DLookup("VendorID", "tblVendors", "Vendor Name = """ & _
NewData & """")) Then

I'm unable to spot anything different from another instance where all
works.
Can someone tell me what I'm missing?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top