By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,434 Members | 2,884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,434 IT Pros & Developers. It's quick & easy.

Trouble referencing a subforms.afterupdate event

P: 3
Hello All-
I am trying to reference a subform's afterupdate event that is 3 deep and am having some trouble getting it to work. The control is a combo box and i cannot seem to trigger the afterupdate event from another subform. The control is on Mainform.Subform1.Subform1.cbocontrol.afterupdate. I am able to plug in a value, but i need to have the event called in order to populate the form.

I am trying to refernce it with the following syntax:
[Forms]![frm_Main]![frm_Subform1]![frm_Subform2] _
.Form![cbo_Control].AfterUpdate

Any help would be great-
thanks in advance
Feb 6 '08 #1
Share this Question
Share on Google+
4 Replies


P: 3
- Hiya- I satisfied this post, but still think that there must be a better way. I was able to call the event by going to the control in the subform and updating its .gotfocus event to refernce the .afterupdate event. Seems a little forced. Any other ideas?
-thanks in Advance
Feb 6 '08 #2

Rabbit
Expert Mod 10K+
P: 12,366
Hello All-
I am trying to reference a subform's afterupdate event that is 3 deep and am having some trouble getting it to work. The control is a combo box and i cannot seem to trigger the afterupdate event from another subform. The control is on Mainform.Subform1.Subform1.cbocontrol.afterupdate. I am able to plug in a value, but i need to have the event called in order to populate the form.

I am trying to refernce it with the following syntax:
[Forms]![frm_Main]![frm_Subform1]![frm_Subform2] _
.Form![cbo_Control].AfterUpdate

Any help would be great-
thanks in advance
You have to use the call command. You have to set cbo_Control's AfterUpdate sub header to public. You're also referencing the Sub incorrectly.
Expand|Select|Wrap|Line Numbers
  1. Call Form_frm_Subform2.cbo_Control_AfterUpdate
  2.  
And this will only work if:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cbo_Control_AfterUpdate()
  2.  
is changed to:
Expand|Select|Wrap|Line Numbers
  1. Public Sub cbo_Control_AfterUpdate()
  2.  
Feb 6 '08 #3

P: 3
Thanks Rabbit!-
I used this and all worked great!
-- I noticed I posted the code wrong- Will not in the future. Thanks again
Feb 6 '08 #4

Rabbit
Expert Mod 10K+
P: 12,366
Not a problem, good luck.
Feb 6 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.