Solved

Call specific control's Afterupdate Event in VBA

Posted on 2012-04-02
3
869 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help writing a query 6 71
Cross Tab with two column values 7 33
addressing a subform frim a subform inside it 8 22
MS Access VBA Print PDF just Current Page 9 10
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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 retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

24 Experts available now in Live!

Get 1:1 Help Now