Link to home
Start Free TrialLog in
Avatar of Shawn
ShawnFlag for Canada

asked on

compile error. expected expression.

I get a compile error. expected expression.

sqlCode = "SELECT * FROM imail_tblIMail where [ClientID] =  & strClient & " And [EnvelopeImageName]   Like  '" & strDoc & "*'"

surely it's a single or double quote I'm missing but am stuck. :(

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The above assumes ClientiD is Numeric.

If it is TEXT, use this:

sqlCode = "SELECT * FROM imail_tblIMail where [ClientID] = '" & strClient & "' And [EnvelopeImageName]   Like  '" & strDoc & "*'"

In case that doesn't work, try this:

sqlCode = "SELECT * FROM imail_tblIMail where [ClientID] = " & Chr(34) & strClient & Chr(34) & " And [EnvelopeImageName] Like " & Chr(34) & strDoc & Chr(34) & " * """

mx
opps ... typo:

sqlCode = "SELECT * FROM imail_tblIMail where [ClientID] = " & Chr(34) & strClient & Chr(34) & " And [EnvelopeImageName] Like " & Chr(34) & strDoc & Chr(34) & "*"


mx
Avatar of Shawn

ASKER

that did the trick. thx
Avatar of Shawn

ASKER

thanks for the alternative mx :)