Hi guys.
Does anyone know if it's possible (if so, how) to store a calculation in a table and run that calculation in VB?
I have about 20 different calculations that I would like to store in a table rather than hard code them so they could be edited by a general user who knows no VB.
For example I have a table called t_JobFunctions with a field called Calc1. In Calc1 I have entered this text: stockoutRatio * stkoutAdj * 100000 * hrsInFctn. The text contains variables which I will lookup from within the same procedure where I would like to use the calculation.
Is there a way I can now run this formula? I had to set the data type in the table to text so when the code looks up the calculation it is in string form so I cannot populate the variables and calculate the result.
Any help will be dearly appreciated. Thanks.
Does anyone know if it's possible (if so, how) to store a calculation in a table and run that calculation in VB?
I have about 20 different calculations that I would like to store in a table rather than hard code them so they could be edited by a general user who knows no VB.
For example I have a table called t_JobFunctions with a field called Calc1. In Calc1 I have entered this text: stockoutRatio * stkoutAdj * 100000 * hrsInFctn. The text contains variables which I will lookup from within the same procedure where I would like to use the calculation.
Is there a way I can now run this formula? I had to set the data type in the table to text so when the code looks up the calculation it is in string form so I cannot populate the variables and calculate the result.
Any help will be dearly appreciated. Thanks.