Using SQL to retrieve a formula?

P

pruetta

I am wondering if there is a way in VBA to extract and use a formula that is
stored in an access table. I have tried and the formula comes in as a string
and it will not work properly. Is there a specific command in VBA that will
allow you to SQL the formula and have it work properly inside of you code?

Thanks,
 
K

Klatuu

The EVAL function will do that.
strFormula = "((5 * 3)/3) + 100"
Foo = Eval(strFormula)
 
P

pruetta

Klatuu,

Thanks. I should have given an example with the formula I am wanting to
retrieve from Access.

Ex. "A + B - 180"

Where A & B are variable that have been set earlier in the code.

Thanks,

pruetta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top