Solved

Call specific control's Afterupdate Event in VBA

Posted on 2012-04-02
3
910 Views
Last Modified: 2012-04-02
Hopefully an easy one...
I want to call the afterupdate event of the control in a parent form, but I am getting tripped up on the syntax.
Any help is greatly appreciated.
0
Comment
Question by:terpsichore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 37796516
<I want to call the afterupdate event of the control in a parent form,>

so you want to call this event from the subform codes..

first, make the  event of the control in the parent form "Public"   i.e., change Private to Public

Public Sub ControlName_afterupdate()


then, use this codes

me.parent.controlname_afterupdate
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37796535
I'm assuming you want to do this from the subform?

In order to do this, I believe you will have to change the declaration statement of the event from Private to Public, something like:

Public sub ctrlName_AfterUpdate

Assuming that your main form is named "frm_Main", then from the subform, You could do:

Call Form_frm_Main.ctrlName_AfterUpdate

you might also be able to do one of the following, but I prefer to use the Form_frm_Main syntax because this provides intellisense.

Call Forms("frm_Main").ctrlName_AfterUpdate

Call me.parent.ctrlName_AfterUpdate
0
 

Author Closing Comment

by:terpsichore
ID: 37796665
worked fine.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question