Unanswered: DLookup with Variable
I am trying to use DLookup with the criteria being equal to a variable. Goes as follows.
Dim class1 as String, DestState as String
DestState = "NY"
class1 = DLookup("[StCode]", "tblEagleCodes", "[State] = " & DestState)
but I keep getting this error.
The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object 'NY.''
I know what you are going to say, its not in the table, but I assure you the value is listed in my table, tblEagleCodes.
Any thoughts on what is wrong, maybe syntax I'm overlooking?
Life's a bowl of punch, go ahead and spike it.