Syntax for control on tabcontrol

T

Tony Williams

I have a form "frmturnover" on which there is asubform "subfrmturnover"
which has three tabcontrols say Page1, Page2 and Page3. There is control
"control2" on Page2 that when its is entered I want to check if it is the
same value as a control "control1" on Page1 and then show a pop up box if
they don't match. I can work out the code for the message box but I'm
getting a little lost on the syntax for referring to the controls on the
pages of the tab control.
I also want to check the value of Control2 on page2 with the vale of
control3 on a page1 of a subform "subfrmmain" on another form "frmmain"
can anyone point me in the right direction?
TIA
Tony Williams
 
B

Brian

Tony Williams said:
I have a form "frmturnover" on which there is asubform "subfrmturnover"
which has three tabcontrols say Page1, Page2 and Page3. There is control
"control2" on Page2 that when its is entered I want to check if it is the
same value as a control "control1" on Page1 and then show a pop up box if
they don't match. I can work out the code for the message box but I'm
getting a little lost on the syntax for referring to the controls on the
pages of the tab control.
I also want to check the value of Control2 on page2 with the vale of
control3 on a page1 of a subform "subfrmmain" on another form "frmmain"
can anyone point me in the right direction?
TIA
Tony Williams

The tab control is a red herring. Simply refer to the controls by their
names, it doesn't matter whether they are on a tab control.

The sytax for referring to the control on a subform of another form would be
something like this:

Forms!frmmain!subfrmmain.Form!controlname

Note that subfrmmain would be the name of the subform CONTROL on the main
form, NOT the name of the form contained in the subform control. Again,
there is no need to worry about tab controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top