View Full Version : Running Module


durdle
07-21-2003, 10:18 AM
Hey,

I was wondering is it possible to run a module inside the Macro builder. I have tried "Runapp" & "Runcode", but they do not work. Inside the module I just open up 4 excel files.

Thanks
durdle

Mile-O
07-21-2003, 12:05 PM
Run a module?

You don't run a module; you call the subroutines and functions within them.

From the macros design view, you can only call functions

i.e. RunCode: =FunctionName(arguments if necessary)

Capt_Poopers
07-07-2004, 04:21 PM
I know this reply is a year late, but there is a way to run a module (sub routine) from a macro. Create a simple form (nothing else is required - no record selectors, no datasource, etc) and attach the code you want to run to the "On Load" event procedure of the form. In the Access macro, use the "OpenForm" command to open the form which, on it's loading, runs the code. Then use "Close" in the macro to close the form, and the rest of your macro can finish.

Mile-O
07-09-2004, 01:23 AM
If you change the Sub to a Function then you can use the RunCode command in a macro.

Personally, I'd advise against using macros at all. They are crap.