Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Calling a module from a Macro


Message #1 by donald.dalessandro@b... on Fri, 20 Jul 2001 18:48:22
Hello everyone,



I have a challenge that I can't seem to overcome.  I hope someone can help 

me out.



I have created a module in an access database called 'DeleteOldFiles'.  The 

purpose of which is to delete old unused files.  I'd like to call this 

module from a macro.  But I can't seem to figure out how to do it.  Does 

anyone have any idea?



Thanks.
Message #2 by "Richard Lobel" <richard@a...> on Fri, 20 Jul 2001 15:20:55 -0700
Any procedure inside your module that you want to run has to be a

function rather than a sub. No problem there as the only difference is

that functions return values but you can ignore the return value. Just

rename your subs functions. Then use the macro action of RunCode. It

takes one argument, the name of the function to run. If you really want

to keep your code in a sub, simply create an additional function that

does nothing but call your sub.

Hope this helps,

Richard Lobel








  Return to Index