Solved

How to go to a control in a parent form?

Posted on 2003-10-27
3
217 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 125 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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 …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

756 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