Run Code on Query Open Action

jamiek555

New member
Local time
Today, 13:52
Joined
Jul 13, 2002
Messages
9
I am using Acc2000. I have a module written that I would like to run as soon as I open a particular query.

It is not a function - it is a procedure. I do not want to use a form (with a button) to run the module.

How can I do this?

Thanks,

JamieK
 
Queries don't expose events where you could put code. You'll need to use a form button's click event or some other form event to run the subroutine or function (you can't run a module) and then open the query.
 
Run Module from Button

Sorry for my lack of skills - I am still learning...

I know how to create a form with a button and how to set the "on click" event - but I am not sure how to direct it to run a module. Can someone please post detailed instructions?

My Module is called "ModUpdateInventory" and the procedure is called "UpdateInventory".

TIA,

Jamiek555
 
The OnClick event might look as simple as this...

Private Sub MyButton_OnClick

UpdateInventory put parameters here

End Sub

But that is bare-bones with no error handling.
 

Users who are viewing this thread

Back
Top Bottom