Avatar of rsb1222
rsb1222

asked on 

Code for Requery for a Combo Box Located in a Sub Subform in a Tab Control

Novice here.  I need code for an After Update event for a Combo Box on a main form.

I want to requery a combo box that is located in a subform of a subform which is located in a tab of a tab control.

Form:  frmOpportunities
Tab Control:  TabCtlOpps
Tab: General
Subform: sbfrmOppProjGeneral
Sub Subform: sbfrmOppProjContact
Control:  cboContactPerson

Here is what I've tried:

Forms!frmOpportunities.TabCtlOpps.General.sbfrmOppProjGeneralInfo.sbfrmOppProjContacts.Form!Controls.cboContactPerson.Requery

(all on one line)

Thanks!
Microsoft Access

Avatar of undefined
Last Comment
Dale Fye
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

the tab control is immaterial to this discussion.

If the combo is on the main form, then you should be able to use something like:

me.sbfrmOppProjGeneral.form.sbfrmOppProjContact.form.cboContactPerson.requery

But your subform description above says the subform name is sbfrmOppProjGeneral, but your line of code says "sbfrmOppProjGeneralInfo"

the general syntax for doing this is:

me.subformControlName.Form.controlname.requery

Make sure the what you are using as the subform control name is if fact the name of the control, not the form (although they may be the same).  In your case, the 2nd subform is simply the control on the 1st subform, so it would be:

me.1stSubformControlName.Form.2ndSubformControlName.Form.Controlname.requery
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo