Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


TabControl Syntax

Posted on 2008-06-18
Medium Priority
Last Modified: 2011-10-19
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!
Question by:ca1358
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 76

Expert Comment

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

strText = Forms!frmMaintenance!text1.text


Author Comment

ID: 21821972
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.

Author Comment

ID: 21946231
I still need a answer to my question.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 76

Expert Comment

ID: 21946432
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.Text = "Hello"
End Sub

Open in new window


Author Comment

ID: 21948968
Here is my example "Cant find field"

click on Form 2

Thank you for your time!
LVL 76

Accepted Solution

GrahamSkan earned 2000 total points
ID: 21949516
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

Author Closing Comment

ID: 31468575
Thank you.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question