G
Georgios Liakopoulos
Hi,
I wish to create a form which will allow the user to enter a function
which will use fields (parameters) from a table to calculate the values
of another field. Since the parameters and the function itself is not
constant, I want to 'translate' the input formula to code. So, here is
an example:
Parameters: parA, parB, parC, etc.
User enters function: strCalc = "parD = (parA + parB) / parC"
I can make a DAO recordset (rst) of the table and also convert the
string to look like: strCalc = "rst!parD = (rst!parA + rst!parB) /
rst!parC".
The problem is: how will I execute this code?
I've tried:
Eval(strCalc)
but produces an error: 'Runtime error 2423: The expression you entered
has an invalid .(dot) or ! operator or invalid parentheses'
The same error is produced even with simpler functions like strCalc =
"rst!parD = rst!parA".
Thanks for any help
I wish to create a form which will allow the user to enter a function
which will use fields (parameters) from a table to calculate the values
of another field. Since the parameters and the function itself is not
constant, I want to 'translate' the input formula to code. So, here is
an example:
Parameters: parA, parB, parC, etc.
User enters function: strCalc = "parD = (parA + parB) / parC"
I can make a DAO recordset (rst) of the table and also convert the
string to look like: strCalc = "rst!parD = (rst!parA + rst!parB) /
rst!parC".
The problem is: how will I execute this code?
I've tried:
Eval(strCalc)
but produces an error: 'Runtime error 2423: The expression you entered
has an invalid .(dot) or ! operator or invalid parentheses'
The same error is produced even with simpler functions like strCalc =
"rst!parD = rst!parA".
Thanks for any help