[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

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!
0
ca1358
Asked:
ca1358
  • 4
  • 3
1 Solution
 
GrahamSkanRetiredCommented:
You can address the control from the form. You don't need to specify the container.

strText = Forms!frmMaintenance!text1.text

0
 
ca1358Author Commented:
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.
0
 
ca1358Author Commented:
I still need a answer to my question.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
GrahamSkanRetiredCommented:
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
0
 
ca1358Author Commented:
Here is my example "Cant find field"

click on Form 2

Thank you for your time!
db1.mdb
0
 
GrahamSkanRetiredCommented:
You forgot to mention that the control (a bound textbox called testfield) is on a subform (Form3) which is on the TabControl page which is in turn on the main form (Form2).

Address it like this:

MsgBox Forms!Form2!Form3!testfield.Text
0
 
ca1358Author Commented:
Thank you.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now