Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a control's Event Procedure from another form

Status
Not open for further replies.

ShinyPen

MIS
Nov 6, 2002
10
0
0
GB
Hi,

In Access '97 I have a main form with a pop up form. Is it possible to call the main form's Event Procedures from the pop up form?

e.g I want to call the main form's "AfterUpdate" procedure for a list box while the pop up form is open and has the focus.

Thanks for any help.
 
You should be able to use the command :
Forms("FormName").ControlName.ProcedureName (Parameters)

Make sure the procedure isn't private to the form (change Private Sub to Public Sub).
 
Thanks for the reply Richard.

My form is called frmPERSON & my listbox is called lstCourseSummary. I've made the lstCourseSummary_AfterUpdate public not private.

I've tried the following syntax and neither work. It comes up with an "Object doesn't support this property or method" error.

Forms!frmPERSON.lstCourseSummary.lstCourseSummary_AfterUpdate

Forms("frmPERSON").lstCourseSummary.lstCourseSummary_AfterUpdate
 
And this ?
Forms!frmPERSON.lstCourseSummary_AfterUpdate

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yes! That's the one.

"Forms!frmPERSON.lstCourseSummary_AfterUpdate" does the trick.

Many thanks both of you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top