Solved

Call specific control's Afterupdate Event in VBA

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dsum Function for List Box Data 7 45
Server configuration for MS Access - SQL Server app 8 69
What's wrong with CopyFromRecordset 6 33
Access Update Query 1 20
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

776 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