Solved

Call specific control's Afterupdate Event in VBA

Posted on 2012-04-02
3
859 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
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now