Oct 23 2007, 11:02 AM
I can't seem to get the correct syntax to execute code that exists in the on_click event of a button on a subform.
I have mainform, mainformbutton, subform and subformbutton. Subform is a continuous form.
In the mainformbutton on_click event i do a few things and then want to call a button on the subform to do some repositioning on the subform.
Can I use the Call approach? If so I would appreciate assistance on how to write the code.
Oct 23 2007, 12:49 PM
Your first hurdle is that a form's events are declared as Private by default.
You need to change the Private keyword to Public before you can call
the code form outside the form's code module.
Personally I would not put code in any event if I wanted to run it from
another module. I would create a separate public sub routine and call
that routine from the Click event and where ever else was necessary.
Oct 23 2007, 01:07 PM
The code is in a public sub on the subform. I needed the syntax to call it from the main form.
Oct 23 2007, 03:47 PM
From the mainform code module:
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here