How can Access/VBA evaluate a variable containing an expression string as an expression rather than as a string?
E.g.,
How do I evaluate the contents of varExpr to get 2 instead of "1 + 1"?
Dlookup() requires a domain, and Access has no equivalent of Excel's Indirect()... Also, I've tried ByVal versus ByRef but it doesn't help. I need something like RunExpression(strExpr) if it exists!!
The bigger context is constructing SQL strings with "parameter" variables or tokens where the parameter tokens are replaced by the value of my own functions such as CurrentFiscalMonth() (e.g, "200709") or ThisMonday() (e.g., #9/17/2007#).
Thanks in advance for any hints![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
E.g.,
Code:
varExpr = "1 + 1"
How do I evaluate the contents of varExpr to get 2 instead of "1 + 1"?
Dlookup() requires a domain, and Access has no equivalent of Excel's Indirect()... Also, I've tried ByVal versus ByRef but it doesn't help. I need something like RunExpression(strExpr) if it exists!!
The bigger context is constructing SQL strings with "parameter" variables or tokens where the parameter tokens are replaced by the value of my own functions such as CurrentFiscalMonth() (e.g, "200709") or ThisMonday() (e.g., #9/17/2007#).
Thanks in advance for any hints