Calling subroutine in subform from parent (1 Viewer)

guy.murray

New member
Local time
Today, 03:40
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
 

allan57

Allan
Local time
Today, 03:40
Joined
Nov 29, 2004
Messages
336
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
 

guy.murray

New member
Local time
Today, 03:40
Joined
Dec 1, 2006
Messages
7
Brilliant! Just what I needed.

many thanks

Guy
 

Kenln

Registered User.
Local time
Yesterday, 22:40
Joined
Oct 11, 2006
Messages
551
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.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:40
Joined
Feb 28, 2001
Messages
27,511
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

Top Bottom