Information générale
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement