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 6159735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:10:55+00:00 2026-05-23T21:10:55+00:00

In Access 2007. We enter a new record on a form. Then we click

  • 0

In Access 2007. We enter a new record on a form. Then we click a button which has a macro action to open another form. What can I do to make the form open but linked to the new record? I understand that I need the primary key on the new form etc. If the record was saved I can make the second form open with that data. But My Question is when it’s still a new record/form we need to navigate directly onto the linked form…

Please share some direction on this..

  • 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-05-23T21:10:55+00:00Added an answer on May 23, 2026 at 9:10 pm

    If I am understanding your question you need to do the following:

    1. Add a new record on Form1
    2. Click a button on Form1 to open Form2
    3. When Form2 opens, it contains the info from Form1

    I have a process that does something similar in my database and we do things this way.

    1. The users have a form to enter new records
    2. They use a button click to post the new data to the table. During this process, I return the primary key to the new record. Then the final process of the button click, I tell it to open the new form, and populate it with the primary key I just grabbed.
    3. New form opens using the PK for the record.

    My code for the button click is in VBA:

    Private Sub OK_Click()
      Dim rst As DAO.Recordset
      Dim rst1 As DAO.Recordset
      Dim sqlStr As String
      Dim RptID As Variant
    
      Set rst = CurrentDb.OpenRecordset("tble_Investigations", dbOpenDynaset, dbSeeChanges)
      ' here you need to add each of your fields from the form
      rst.AddNew
          rst![Table.Column1] = Me![FormField1]
          rst![Table.Column2] = Me![FormField2]
          rst![Table.Column3] = Me![FormField3]
      rst.Update
    
      ' my sql string to return the new ID of the record I just added
      sqlStr = "Select Max([ID]) as [MaxOfID] from tble_Investigations;"
      Set rst1 = CurrentDb.OpenRecordset(sqlStr, dbOpenDynaset, dbSeeChanges)
      rst1.MoveFirst
    
      RptID = rst1![MaxOfID]
    
      'here we open the Form2 with the new id.
      DoCmd.OpenForm "Frm_Details", acNormal, , "[ID]= " & RptID, acFormEdit, acWindowNormal
      DoCmd.Close acForm, "Frm_New", acSaveYes
    
    End Sub
    

    EDIT:

    Based on what you are telling it sounds like you are doing the following:

    Private Sub OK_Click()
      Dim rst As DAO.Recordset
      Dim rst1 As DAO.Recordset
      Dim sqlStr As String
      Dim RptID As Variant
    
      Set rst = CurrentDb.OpenRecordset("t_Evaluation", dbOpenDynaset, dbSeeChanges)
      ' here you need to add each of your fields from the form
      rst.AddNew
          rst![ExecutionLeadOrg] = Me![ExecutionLeadOrg] 'the field from your form that matches the table column
          rst![TitleID] = Me![TitleID]
          rst![t_Evaluation.EvalTypeID] = Me![t_Evaluation.EvalTypeID]
          rst![SectionID] = Me![SectionID]
          rst![LOBEvaluation] = Me![LOBEvaluation]
          'you need to continue doing this for each field on your form
      rst.Update
    
      ' my sql string to return the new ID of the record I just added
      sqlStr = "Select Max([EvaluationID]) as [MaxOfID] from t_Evaluation;"
      Set rst1 = CurrentDb.OpenRecordset(sqlStr, dbOpenDynaset, dbSeeChanges)
      rst1.MoveFirst
    
      RptID = rst1![MaxOfID]
    
      'here we open the Form2 with the new id.
      DoCmd.OpenForm "f_LOBevalPopUpEntry", acNormal, , "[EvaluationID]= " & RptID, acFormEdit, acWindowNormal
      DoCmd.Close acForm, "F_EvalNew", acSaveYes
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a form in Access 2007, there is a Text Box that has: @
I have a data set (currently in Access 2007 format) which has 2 tables,
I've created an Access 2007 form that displays, for example, Products from a Product
Access 2007 is telling me that my new expression is to complex. It used
I have an Access 2007 form that is using an ActiveX Treeview control with
I have a form in MS Access 2007. To change from one inputfield to
I have an MS Access 2007 subform that is displaying data in continuous form
I have a access 2007 report for which one of the fields returns a
We have an MS Access 2007 database with a simple form displaying table data.
I am running a Access 2007 database which is filled by users which only

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.