General information
Title:
How to calculate from a string like
My database contains a table of formulas that the users can insert into and edit. Being in a database field, they are stored as strings. How do I get VB to calculate the formula, once I read the formula string in from the database? My formulas are very complicated but using the example 'x + y', how do I get VB to calculate the value and give me the result? If I read the string into a variable like Calculation (ex. Calculation = rsDBcalc("Formula")), can I do something like Execute(Calculation) which would return the value of x + y ?
For a more complicated situation, if the database Formula field = 'IF a > b THEN a - b ELSE b - a END IF', how can I do that?
Much thanks for your time.
John
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only