"Page" on a form - need to reference

Geordie2008

Registered User.
Local time
Today, 17:11
Joined
Mar 25, 2008
Messages
177
Hi all,

I have a text box within a "page" on a form.

this text box is used to filter one of my queries, previously I had it on the form and the syntax was:

[Forms]![frm_Select_Tier_II_Owner]![cbo_Select_Tier_II_Owner]

What syntax do I now require to reference the Page within the form as its not working since I moved the textbox onto the page

The page is called "Comparative"

Thanks,
Mandy
 
Sorry - I think it might be called a "tab control"?

Not a "page"

Thanks,
Mandy
 
If you are referencing controls on a tab control, just ignore the tab control as if it wasn't there.
 
Wow.... I'd well tried to overcomplicate things!

Thanks,
Mandy
 
Put the form in design mode and show the properties of the Text Box (you can double click the tab to show the properties sheet). Click the All Tab of the Properties sheet, and the name of the Text Box will be the first item on the list.

Refer to the text box as YourFormName.Form!TextBoxName


YourFormName and TextBoxName come from above. Form! is a literal and should be typed as is.

As Usual boblarson comes to the rescue before me with an even easier explanation
 
Last edited:
Put the form in design mode and show the properties of the Text Box (you can double click the tab to show the properties sheet). Click the All Tab of the Properties sheet, and the name of the Text Box will be the first item on the list.

Refer to the text box as YourFormName.Form!TextBoxName


YourFormName and TextBoxName come from above. Form! is a literal and should be typed as is.
Actually, the .Form part just needs to be there if referencing a subform, not a tab control. Controls on a tab control, if not on a subform, require no special referencing, but only as if they were on the form and not on the tab control.
 
And actually, a little bit more about the .Form. or .Form! part that was said:

This has to do with referencing subforms and the reason why you use the .Form. part when referencing subforms is that you are actually referring to the subform container control on the main form when you do Forms!YourMainForm.YourSubformContainerName and then to refer to any of the subform properties, or methods, you need to add the .Form. between so that Access will know that you are referring to something on the subform itself and not the subform container control.

If you were to refer to

Forms!YourMainForm.YourSubform.Requery

That would be telling Access to requery the subform container, but a subform container doesn't have a requery method, but the subform itself does. So, you would need to use

Forms!YourMainForm.YourSubform.Form.Requery

Hopefully that helps cement some subform theory/syntax for you.
 
Actually, the .Form part just needs to be there if referencing a subform, not a tab control. Controls on a tab control, if not on a subform, require no special referencing, but only as if they were on the form and not on the tab control.

Thanks for the information. I will look into what you said. I just copied what was on one of our text boxes that was referring to control that was contained on a tab control.
 

Users who are viewing this thread

Back
Top Bottom