cbo Lookup Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What changes do I need to make to the following to allow lookup of office
names that include apostrophies?

rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"


These kind of syntax errors just drive me NUTS, someday I will understand
the rules.

Thank you in advance
 
Jeff C said:
What changes do I need to make to the following to allow lookup of
office names that include apostrophies?

rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"


These kind of syntax errors just drive me NUTS, someday I will
understand the rules.

Thank you in advance

You can do what is often called "doublequoting"

rs.FindFirst "[Office_Name] = """ & Me![cbo_Office] & """"

but - when doing lookups like this, don't you have a primary key field
within the combo you could use?
 
Thanks Allen I printed up your tutorial too.

Thanks to you too Roy
--
Jeff C
Live Well .. Be Happy In All You Do


Allen Browne said:
Try:
rs.FindFirst "[Office_Name] = """ & Me![cbo_Office] & """"

For an explanation, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jeff C said:
What changes do I need to make to the following to allow lookup of office
names that include apostrophies?

rs.FindFirst "[Office_Name] = '" & Me![cbo_Office] & "'"


These kind of syntax errors just drive me NUTS, someday I will understand
the rules.

Thank you in advance
 

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

Back
Top