Solved

TabControl Syntax

Posted on 2008-06-18
7
172 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now