I think post #15 (Use TempVars) is more close to the real solution. Thank you Sir!
Eval("Forms!formname!controlname")
TempVars have always been a solution looking for a problem but there is always a better way.
TempVars have always been a solution looking for a problem but there is always a better way.
I also never use tempvars.
As an alternative, you can use a public variable and a function
e.g. Set strCriteria= Me.controlname on a form
Have a module function GetCriteria and set it = strCriteria
Then use GetCriteria in the query criteria
This idea can be used endlessly throughout your application.
Colin,
I feel I am missing something completely here.:banghead:
Surely that still involves VBA.
Is not a Tempvar just a permanent public variable.?
Well technically it's like a temporary public variable.
Yes it involves using VBA. Where does this thread say no VBA allowed?
Well technically it's like a temporary public variable.
Post 23 says that approach is clumsy as it uses VBA, not that it is not allowed.?
How would one run a query that could be used from several forms/reports not using tempvars?
What I said was that the query could not be run without setting the TempVar. The Eval solution doesn't require any VBA to run the query directly.