Call subroutine in parent forms code module

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
 
M

Marshall Barton

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, ...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top