Query with table name as variable

Avizan05

New member
Local time
Today, 10:11
Joined
Apr 30, 2014
Messages
9
Hi,

In my application, table for a query is choosen based on the user input.I have declared the user input as Tempvars.I want to know how to use the variable in query design(not using VBA).
 
Thanks eugin for your response.

As i have mentioned, i am using tempvars not in code(VBA) but in query design mode of access and i have given try with all the suggested method from your link.none seems to be working..
I am getting an error message : "syntax error in from clause" since the syntax has parentheses or exclamation mark which are not accepted.
 
Not sure how are you using, it should be like TempVars!yourVariableName
 
In my application, table for a query is choosen based on the user input.I have declared the user input as Tempvars.I want to know how to use the variable in query design(not using VBA).

This cannot be done without building a dynamic query VBA.

Moreover, such a requirement usually indicates the data structure is wrong. It would appear you are storing information by putting records into different tables. Information should not be held in this way.
 

Users who are viewing this thread

Back
Top Bottom