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

x
?
Solved

How to go to a control in a parent form?

Posted on 2003-10-27
3
Medium Priority
?
225 Views
Last Modified: 2008-02-26
I have a main form with a tab control (TabCtl4). Each page has a subform in it. I want to put a button in each subform that navigates to the next tab page (named Page2, index 1) in the main form. I can't seem to get the syntax right:

Private Sub Command23_Click()
    DoCmd.GoToControl Forms!frmMain!TabCtl4.Pages(1)
    DoCmd.GoToControl [Forms]![frmMain]!Page2
    DoCmd.GoToControl Forms!frmMain!TabCtl4.Item(1)
    DoCmd.GoToControl Forms.frmMain.Page2
End Sub

thanks,
triplediamond
0
Comment
Question by:triplediamond
[X]
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
3 Comments
 
LVL 5

Expert Comment

by:gwgaw
ID: 9631542
Try this.

Private Sub Command23_Click()
Me.Parent.TabCtl4 = 1
End Sub

gaw
0
 
LVL 2

Accepted Solution

by:
sigs66 earned 500 total points
ID: 9631928
Hi all

Try this one    
Private Sub Command23_Click()
  Me.Parent("Page2").SetFocus
end sub

Cheers
Steve
0
 

Author Comment

by:triplediamond
ID: 9635844
I've found that this works:
    DoCmd.OpenForm "frmMain"
    DoCmd.GoToControl "Page2"

I just tested Steve's answer and that works also. Thanks
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

715 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