Solved

How to go to a control in a parent form?

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

734 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