How to call Sub in a code module from outside of Access

G

Guest

I have an application that performs various data transformation tasks on some
Access bases. Now, the definitions of the actions to be performed is
contained in a separate Control database.
One of the tasks is execution of a VB Sub in a code module in one of the
target databases (those that the data transformation tasks are done on). The
name of the database, the module and the Sub procedure resides in the control
database. My execution engine is a separate program (EXE) that is connected
to the control database through ADO. The target database that the next step
is performed is opened in Access through Automation.
Now, since my execution engine reads the name of the module and sub from the
control database, I need a way to execute the a Sub dynamically - i.e. I do
not beforehand know the name of the module and sub, so I cannot hard code it
into the execution engine program.
I am not sure how to go about that. Can someone help me here?


Best regards,
 
M

Marshall Barton

Frank said:
I have an application that performs various data transformation tasks on some
Access bases. Now, the definitions of the actions to be performed is
contained in a separate Control database.
One of the tasks is execution of a VB Sub in a code module in one of the
target databases (those that the data transformation tasks are done on). The
name of the database, the module and the Sub procedure resides in the control
database. My execution engine is a separate program (EXE) that is connected
to the control database through ADO. The target database that the next step
is performed is opened in Access through Automation.
Now, since my execution engine reads the name of the module and sub from the
control database, I need a way to execute the a Sub dynamically - i.e. I do
not beforehand know the name of the module and sub, so I cannot hard code it
into the execution engine program.
I am not sure how to go about that. Can someone help me here?



I don't see how to incorporate the module name into it, but,
as long as you don't have the same procedure name in
multiple modules in the same mdb, you should be able to use
the Application.Run method. An alternative may be to use
the Eval function, but Run is provided for this purpose.

Check Help for details.
 

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