How to run a Module from a macro

zyzor

Banned
Local time
Yesterday, 21:50
Joined
Sep 26, 2008
Messages
64
Dear access programmers :)

I've come to an end of my project!
There is only 1 thing to solve..

I NEED to run a macro ( i know it sux, please don't try to make an other solution for this)
I made an public module, now i need the macro to run the module.
How do i do this ? :)

When i select runcode it see's the function, it sees module but i cannot say open this one.

Do i need to make the code in the module a function to be opend in a macro ? or can i make something that the macro opens the module i want?


thanks in advance ,
i hope you guys can help , since i want this project to end ;)


Nevermind got it to work!
Put the module code in a function +_+
Sorry.
:D
 
Last edited:
The code in the module needs to be a Public Function - after that, you should be able to browse to it by clicking the ... next to the Function Name box when you add a RunCode item to your macro.

Another way to do it would be to create an unbound form, stick a label on it saying "running code' (or whatever), paste the code into the OnLoad event of the form (adding a command to close the form when it's done), then use the OpenForm command in your macro
 
Modules are containers for public functions and sub routines. The question is where in your application are you attempting to call a function that resides within a module? and more important what is the function doing?

If it is within VBA you can simply use the Call command to action the function

Call YourFunctionName()


More info would be better.

David
 

Users who are viewing this thread

Back
Top Bottom