Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a macro/runcode to run a Sub

Status
Not open for further replies.

travismallen

Programmer
Aug 5, 2003
15
US
I have a module named "NewHireEmail" and a sub named "OutlookPump()". Can someone help me with the code for a function that runs this sub?

I think I need to use something like...

Call DoCmd.OpenModule(NewHireEmail, OutlookPump())

Not sure if the module and sub names need quotes though...

thx



___________________________
"I am what I am" - Popeye
Travis M. Allen
 
Why not simply this ?
OutlookPump

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
There are 3 modules and all have a sub named "OutlookPump" but they do different things so I need to specify which one.

I also read macros can't run subs and that I'd need to make a function that calls it.

___________________________
"I am what I am" - Popeye
Travis M. Allen
 
NewHireEmail.OutlookPump

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Do I put this in a new function or directly in Function Name for runcode in my macro?

___________________________
"I am what I am" - Popeye
Travis M. Allen
 
You asked in a VBA forum, so I posted VBA code.
I personally don't play with macro.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top