1

I am getting the error 'Syntax error (missing operator) in query expression:

'tblFICL.Product = Muni/Money Market AND tblFICL.Broker_Code = WELLS'

The full vba query is below. I am guessing this has something to do with my variables prdct and bkr. What syntax am I missing in this query?

'Set and Excecute SQL Command'
strSQL = "SELECT tblFICL.Email " _
    & " FROM tblFICL " _
    & " WHERE tblFICL.Product = " & prdct & " AND tblFICL.Broker_Code = " & bkr & ""

Been looking at this all day, any help would be greatly appriciated.

1 Answer 1

4

You may need apostrophes before and after your values. Try code below

strSQL = "SELECT tblFICL.Email " _
    & " FROM tblFICL " _
    & " WHERE tblFICL.Product = '" & prdct & "' AND tblFICL.Broker_Code = '" & bkr & "'"
Sign up to request clarification or add additional context in comments.

2 Comments

This works! Thank you! Now I will be able to sleep tonight.
@loha86 -- you can also say thank-you by accepting the answer. Click the checkmark at the top left.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.