Calling subroutine in subform from parent

guy.murray

New member
Local time
Today, 19:25
Joined
Dec 1, 2006
Messages
7
Hi,
I have a subForm in which I have defined a subroutine. I want to call this subroutine from an event in the parent form.

Would be much obliged if someone could explain how to do this.

Guy
 
I use the following to call a procedure from another form:

form_PutYourFormNameThatHoldsTheProcedureHere.TheNameOfYourProcedure

Example:

the procedure I wish to call is named CheckForCommonMaterial held in form fsubSolutions_BOM which is the source of my sub form.

i.e.

form_fsubSolutions_BOM.CheckForCommonMaterial
 
Brilliant! Just what I needed.

many thanks

Guy
 
I usualy test to see if the main form is open before I call the procedure. This, of course, is only needed if the sub_form can be opened independently.
 
There is also the consideration that if the subroutine is one that might be called from more than one form, or if it can be called from varying depths of form, perhaps it should not be in a form's class module. Instead it should be in a general module published PUBLIC.

Just a thought, perhaps as a matter of style rather than anything technical. I just would find it easier to make that reference.
 

Users who are viewing this thread

Back
Top Bottom