Hello,
I am trying to pass the value in a global variable to a query. I know this can't be done explicitly, but I've used a small function called get_global that returns the value of the variable. When I do this:
msgBox (get_global("Ke yWordsSelected" )
I get a message box with exactly the value I want (I am just doing this for debugging purposes; it is not a crucial element of the application). In this example, say it returns
'Air Quality'
When I take this value (that's in the message box) and copy it into my query, it works perfectly. For example:
WHERE (((tblSubProjec tKeyWords.Proje ctKeyWords)='Ai r Quality'));
However, when I use
WHERE (((tblSubProjec tKeyWords.Proje ctKeyWords)=get _global("KeyWor dsSelected")));
I get nothing returned.
I am trying to cobble this together knowing little about SQL or Access, so I would appreciate any advice. Is there some syntax rule I am not following?
Thanks!
Whitney
I am trying to pass the value in a global variable to a query. I know this can't be done explicitly, but I've used a small function called get_global that returns the value of the variable. When I do this:
msgBox (get_global("Ke yWordsSelected" )
I get a message box with exactly the value I want (I am just doing this for debugging purposes; it is not a crucial element of the application). In this example, say it returns
'Air Quality'
When I take this value (that's in the message box) and copy it into my query, it works perfectly. For example:
WHERE (((tblSubProjec tKeyWords.Proje ctKeyWords)='Ai r Quality'));
However, when I use
WHERE (((tblSubProjec tKeyWords.Proje ctKeyWords)=get _global("KeyWor dsSelected")));
I get nothing returned.
I am trying to cobble this together knowing little about SQL or Access, so I would appreciate any advice. Is there some syntax rule I am not following?
Thanks!
Whitney
Comment