Solved

TabControl Syntax

Posted on 2008-06-18
7
175 Views
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!
0
Comment
Question by:ca1358
  • 4
  • 3
7 Comments
 
LVL 76

Expert Comment

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

strText = Forms!frmMaintenance!text1.text

0
 

Author Comment

by:ca1358
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.
0
 

Author Comment

by:ca1358
ID: 21946231
I still need a answer to my question.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 76

Expert Comment

by:GrahamSkan
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.SetFocus
    Text1.Text = "Hello"
End Sub

Open in new window

db1.mdb
0
 

Author Comment

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

click on Form 2

Thank you for your time!
db1.mdb
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 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
0
 

Author Closing Comment

by:ca1358
ID: 31468575
Thank you.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 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