Call subroutine in parent forms code module

  • Thread starter Thread starter Dale Fye
  • Start date Start date
D

Dale Fye

I have a subform that displays data in a datasheet view.
When the user checks a box on the form, I want to execute
code in the parent forms code module.

How do I call that subroutine from within the OnClick
event of the child forms.

Public Sub chk_DoThis_Click()

Me.Dirty = False
Call ???????????????????????

End sub
 
Dale said:
I have a subform that displays data in a datasheet view.
When the user checks a box on the form, I want to execute
code in the parent forms code module.

How do I call that subroutine from within the OnClick
event of the child forms.

Public Sub chk_DoThis_Click()

Me.Dirty = False
Call ???????????????????????

End sub


A Public sub procedure in a form's module is a Method of the
form so you can call it by referencing the form object, a
dot and the procedure's name. In the case of a parent form:

Parent.yoursubproc arg1, ...

or for a function procedure:

xx = Parentt.yourfuncproc(arg1, ...)
 
Back
Top