Hello,
In Access 2000, 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:
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:
However, when I use
I get nothing returned.
I am trying to cobble this together with little training in SQL or Access, so I would appreciate any advice.
Additional information:
--get_global returns a string
--tblSubProjectKeyWords.ProjectKeyWords is a text field
--I have also tried storing the value I want in a text box, with the same result - a msgBox shows the correct value, but it does not resolve correctly within the WHERE statement.
Thanks!
Whitney
In Access 2000, 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:
Code:
msgBox (get_global("KeyWordsSelected")
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:
Code:
WHERE (((tblSubProjectKeyWords.ProjectKeyWords)='Air Quality'));
However, when I use
Code:
WHERE (((tblSubProjectKeyWords.ProjectKeyWords)=get_global("KeyWordsSelected")));
I get nothing returned.
I am trying to cobble this together with little training in SQL or Access, so I would appreciate any advice.
Additional information:
--get_global returns a string
--tblSubProjectKeyWords.ProjectKeyWords is a text field
--I have also tried storing the value I want in a text box, with the same result - a msgBox shows the correct value, but it does not resolve correctly within the WHERE statement.
Thanks!
Whitney