Run Module Thru Macro (1 Viewer)

HaroldIII

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2011
Messages
55
Ok...now I think im losing my mind.

Im trying to create a macro that will run a module named Output2()

Right now i have action "RunCode" then Arguments "Output2()"

Please help
 

DCrake

Remembered
Local time
Today, 10:11
Joined
Jun 8, 2005
Messages
8,632
You don't run modules you call functions and subroutines within the modules.
 

vbaInet

AWF VIP
Local time
Today, 10:11
Joined
Jan 22, 2010
Messages
26,374
To be honest, I won't rely on a macro to run a function. To run the function just type:

Call Output2

OR

Output2

In any case, did you put the function in a Standard Module or a Class Module? It needs to be in a Standard Module. Not a form module, not a report module and not a Class module.
 

HaroldIII

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2011
Messages
55
then how do i run (Call) this module to output the reports i need?
 

vbaInet

AWF VIP
Local time
Today, 10:11
Joined
Jan 22, 2010
Messages
26,374
You don't run Call, Call calls or runs the function as the name implies.
 

HaroldIII

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2011
Messages
55
You don't run Call, Call calls or runs the function as the name implies.

Haha...dude..you spun my head a total 360 with that last post...:confused::confused::confused::confused:

Please let me clairfy what im trying to do. I have a module saved as Output2. This module takes my queries and outputs them into excel spreadsheets in a specific folder.

I need to create something that will Run this module with just a click of a mouse.
 

DCrake

Remembered
Local time
Today, 10:11
Joined
Jun 8, 2005
Messages
8,632
Inside your module Output2 you should have a function that is doing the task you have set

What is this function called?
 

vbaInet

AWF VIP
Local time
Today, 10:11
Joined
Jan 22, 2010
Messages
26,374
Don't name the module the same name as the function. Change the name of the module to mdlOutput or basOutput.

I've already explained how to run the function (that is inside the module) in post #6.
 

HaroldIII

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2011
Messages
55
sorry missed 11 cause of the double post...

I renamed the module to basoutput

Function Output2()
 

HaroldIII

Registered User.
Local time
Today, 05:11
Joined
Feb 2, 2011
Messages
55
... and??


And now i see why you are the "AWF VIP" and I am the "NOOB"

i created the Macro and it worked. Access was getting confused because i had the module and the function with the same name:D

Thanks!!!
 

Users who are viewing this thread

Top Bottom