Dear All
I’m trying to use a simple SQL string in VBA to validate an option, here’s the SQL and the line I get the error on. I’m thinking that maybe I need to define the strCurrentUser Variable? It is currently set to the CurrentUser from the Access Security log in.
strCurrentUser = CurrentUser
SQLInfo = “SELECT * FROM ConcessionNamesTbl WHERE ConcessionAwardee LIKE ” & strCurrentUser
Set RstUserInfo = DbS.OpenRecordset(SQLInfo)
I’ve checked that the variable strCurrentUser has been assigned a value, I’ve modified the SQL string to contain the value and everything works fine then, so, how do I persuade Access that the variable is what it needs? I’ve also tried using the = symbol, switching to LIKE as I’d heard this might allow Access to match different types of variable more easily.
Thanks
Ian