Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TabControl Syntax

Posted on 2008-06-18
7
Medium Priority
?
182 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
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

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 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
0
 

Author Closing Comment

by:ca1358
ID: 31468575
Thank you.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

927 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