Subform on Form Page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the correct syntax for referencing a subform on a tab(page) on a form?

What about a field in the current record in a subform on a tab(page) on a form?


thanks

Ken
 
The full path would be

Forms!frmNameOfMainForm!ctlNameOfSubformControl.Form!ctlNameOfControl

If the code is on the main form then Forms!frmNameOfMainForm can be replaced
with Me. The subform control is a control on the main form that acts as a
container for the subform. To get the name of this control, open the main
form in desgin mode, open the Properties sheet, click on the subform ONE
time. The Properties sheet should show the name of the subform control. If
you click a second time, you'll be in the subform and the Properties sheet
will show the name of the subform, not the control holding it.

Controls on a tab are refered to as if they were on the form itself.
 
If referencing from code in the main form:
Me!yoursubform.Form
Me!yoursubform!yourcontrol

From elsewhere:
Forms!yourform!yoursubform.Form
Forms!yourform!yoursubform!yourcontrol
 
Thank you

Alphonse Giambrone said:
If referencing from code in the main form:
Me!yoursubform.Form
Me!yoursubform!yourcontrol

From elsewhere:
Forms!yourform!yoursubform.Form
Forms!yourform!yoursubform!yourcontrol
 
Thank you

Wayne Morgan said:
The full path would be

Forms!frmNameOfMainForm!ctlNameOfSubformControl.Form!ctlNameOfControl

If the code is on the main form then Forms!frmNameOfMainForm can be replaced
with Me. The subform control is a control on the main form that acts as a
container for the subform. To get the name of this control, open the main
form in desgin mode, open the Properties sheet, click on the subform ONE
time. The Properties sheet should show the name of the subform control. If
you click a second time, you'll be in the subform and the Properties sheet
will show the name of the subform, not the control holding it.

Controls on a tab are refered to as if they were on the form itself.
 
Back
Top