I have an Access parameter query that calls a module function chk1(). What I'm trying to supply as a parameter via the function is the following 14 characters, including spaces and the 'or' ....
"AAA" or "BBB"
which works when typed directly into the criterion cell for the query, but doesn't when I use it in a function...
The criteria I have calls this function chk1. If I use the simple statement in the function: chk1 = "AAA" , it does work for that, so the call is ok, just my dang quotes aren't right - assuming an 'or' statement can be supplied programmically. I've tried a bunch of combinations of ' and " and & chr(34) and & chr (39), just haven't got it yet. Please help.
The function will be more involved than this to produce the string, but knowing the answer to this will help me enough for now. I don't get an error, it just doesn't return the data.
"AAA" or "BBB"
which works when typed directly into the criterion cell for the query, but doesn't when I use it in a function...
Code:
Public Function chk1()
chk1 = "'AAA' OR 'BBB'"
End Function
The criteria I have calls this function chk1. If I use the simple statement in the function: chk1 = "AAA" , it does work for that, so the call is ok, just my dang quotes aren't right - assuming an 'or' statement can be supplied programmically. I've tried a bunch of combinations of ' and " and & chr(34) and & chr (39), just haven't got it yet. Please help.
The function will be more involved than this to produce the string, but knowing the answer to this will help me enough for now. I don't get an error, it just doesn't return the data.