Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:30:37+00:00 2026-06-03T22:30:37+00:00

I have a main form with a tab control, and each tab has a

  • 0

I have a main form with a tab control, and each tab has a different subform. Two of the subforms have the same underlying query (a list of projects). I have a button that I want to take the user from the first tab to the second tab, but I want the record on the second tab to be the same as it was on the first tab.

For example, if this is the structure (but between frmMaster and the subforms is a tab control, but I don’t think that impacts what I’m trying to do):

frmMaster
- frm_Sub1 (on the first tab)
- frm_Sub2 (on the second tab)

And a user navigates a certain project on frm_Sub1, I want them to be able to hit a button, and they will be taken to that same project record on frm_Sub2. I can set focus on the second tab (using Forms!frmMaster.form!TabCtl0.Pages(1).SetFocus), but I can’t get the subform on that tab to jump to the correct record. I think it’s just an issue with how I’m trying to reference the subform–any suggestions? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:30:38+00:00Added an answer on June 3, 2026 at 10:30 pm

    Let us say I have a comand button on the main form:

    Private Sub ACommand_Click()
      Me.SubformControlOnPage2Name.SetFocus
      With Me.SubformControlOnPage2Name.Form.Recordset
          .FindFirst "AKeyID=" & Me.SubformControlOnPage1Name.Form.ASimilarKey
      End With
    End Sub
    

    You do not need to refer to a page to refer to the control on that page. Controls are unique to a form. Be careful to use the name of the subform control, not the name of the form contained.

    EDIT re Comments

    Let us say I have a comand button on the first subform:

    Private Sub ACommand_Click()
      Me.Parent.SubformControlOnPage2Name.SetFocus
      With Me.Parent.SubformControlOnPage2Name.Form.Recordset
          .FindFirst "AKey=" & Me.AKey
      End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main form with a tab control containing multiple subforms. I need
I have a main form at present it has a tab control and 3
I have created a list form that gets attached to a main form in
I have an app with a TPageControl on the main form. The pagecontrol has
I have a C++/CLI project which has a child form with some control components.
I have a windows form i want to start on different tab pages from
I have a two tab page, one tab is the record list, click on
I have a windows forms project. It has a main form derived from System::Windows::Forms::Form
I have a main form, and a floating child form that is non-modal. The
I have a main form and non-modal autocomplete form. How can I prevent the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.