Get around " in VB

G

Guest

Hello,

I got a little coding to filter some data and display them on a report.
When I use the following code, it works:
DoCmd.OpenReport strDoc, acViewPreview, , "([Supplier]
IN(""SLM"",""NLM"",""NOVELIS""))", acNormal

But I want to program so that a user can pick the suppliers and the program
filter with the following code:

strWhere = "([Supplier] IN (" & SupplierBeta & "))"
DoCmd.OpenReport strDoc, acViewPreview, , strWhere, OpenArgs:=strWhere

If I pick SLM, NLM and NOVELIS as suppliers, OpenArgs said my code is the
same as the WhereCondition, however the program said I am "missing operator"?
It has something to do with the apostrophes at both ends of the
WhereCondition. How do I put apostrophes at the ends of the statement
without it thinking I put in a space?
 

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