HOWTO: Call a function behind a form from a module

tylersontag

Registered User.
Local time
Today, 14:51
Joined
Sep 2, 2009
Messages
19
I'm wanting to automate a process, so concurrent to the normal execution of a form (Open another form, prompt questions, display stuff, comit changes... etc) i've made a Function that calls existing functions behind the form and automates the responces to bypass the need to have a user actually sit there and make all the choices...

Now this being automated, i have a daily job that will run the MDB with the parameters to run a module called "AutoLoad"... my question is, how can my module call code that is in a yet unopened form? I've seen it in reverse, but never in this direction... any help?
 
I'm afraid that in order for code in a form to execute, the form needs to be open.
 
Maybe I am not fully understanding the question cause it feels like my answer is too easy - but cant you get "AutoLoad" to open the form?
 
Sure could, so what would be the syntax to open a form from a module? Then would i just pass a parameter or a condition to tell it to run my specific "AutoLoad" function?
 
Sure could, so what would be the syntax to open a form from a module? Then would i just pass a parameter or a condition to tell it to run my specific "AutoLoad" function?

OK I must be lost....
You have a job that runs the mdb

mdb runs "autoload"?
Or you trying to find out how to run "Autoload"

Help me with the desired workflow
 
I have a vb script that opens my MDB with a command line argument to run the "AutoLoad" macro

The "AutoLoad" macro simply does a RunCode pointing the the "Auto_Load" function within one of my Modules.

(Brickwall)In this function, i'd like to call and run some existing code behind one of my forms.

So thats the last link in the chain of me being done with this project of ever increasing scope :D
 
Cool

To Open the form the code will be:
DoCmd.OpenForm "FormName",,,,,,Lots of options - look up help
In order to run the code behind the form, the events you need to call have to be public

Ie Where you have Private Sub Button_Click() change it to Public Sub Button_Click()

To Call It use Form_FormName.Button_Click
 

Users who are viewing this thread

Back
Top Bottom