Solved

How to go to a control in a parent form?

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

778 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