Link to home
Start Free TrialLog in
Avatar of ca1358
ca1358

asked on

TabControl Syntax

This is Access VBA 2003
What would be the correct syntax of this statement?

1. Main Form is frmMaintenance
2. TabControl name-- TabControl
3. Page name[ Roll_YieldException]
4. field [text1]

If IsNull(Forms!frmMaintenance.TabControl.Pages.[Roll_YieldException].[text1]) Then

Any help would greatly be appreciated!
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

You can address the control from the form. You don't need to specify the container.

strText = Forms!frmMaintenance!text1.text

Avatar of ca1358
ca1358

ASKER

It didnt work - it gave me runtime error 2465 Maintenance cant find the field "text1" referred to in your expression.

Any other suggestions would be appreciated.
Thank you.
Avatar of ca1358

ASKER

I still need a answer to my question.
I have appended a database in 2000 format with a form containing a textbox on a page of a Tab control. The command button on the form adds some text to the text box. The code is shown in the snippet.
Private Sub Command5_Click()
    Text1.SetFocus
    Text1.Text = "Hello"
End Sub

Open in new window

db1.mdb
Avatar of ca1358

ASKER

Here is my example "Cant find field"

click on Form 2

Thank you for your time!
db1.mdb
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ca1358

ASKER

Thank you.