Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 987
  • Last Modified:

Call specific control's Afterupdate Event in VBA

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
terpsichore
Asked:
terpsichore
1 Solution
 
Rey Obrero (Capricorn1)Commented:
<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
 
Dale FyeCommented:
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
 
terpsichoreAuthor Commented:
worked fine.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Tackle projects and never again get stuck behind a technical roadblock.
Join Now