Running VBA code stored in a DB column?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some simple mathematical formulas that take zero, one or two inputs
(a, b and c, how original...). Here's an example...

ret = A * 0.23

I know the values of a, b and c in VBA code, and that's the only place it
can be, so up to now I've been putting the code in VBA modules and calling
it. The problem is that the code sometimes changes, and in other times can't
be edited (file is busy) so it's difficult to fix them on the fly.

So... is there a way I can put the formula text into the database, where
anyone can edit it, then load it up and run it from within the VBA code?

I seem to recall figuring out how to do this in SQL code in the past, but
the inputs are in the VBA side, so that doesn't really work (at least not
easily).

Maury
 
Maury

I'm not sure if it would apply in your situation, but take a look at the
Eval() function.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff Boyce said:
I'm not sure if it would apply in your situation, but take a look at the
Eval() function.

Ahhh! Yes, I kept looking for "exec". Thanks!

Maury
 

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

Back
Top