• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Ms Access Forms Go To New Record after confirmation form runs


I have two forms, frmGrindScrap and frmGrindScrapConfirm.  When the command button cmdUpdateLbs is clicked on frmGrindScrap the frmGrindScrapConfirm form opens.

When the user confirms the data it runs an update query to update the information for that record.  After this query runs I would like to set the first form (frmGrindScrap) to a new record. so that the user does not have to click the "New Record" command button.

I figure the code would go right after the DoCmd.Close that closes the confirmation form, I just can't figure out what it should be.

Thanks for your help in advance and have a great day!
   screenshot of main and confirmation form.
Private Sub cmdUpdateRegrind_Click()
On Error GoTo Err_cmdUpdateRegrind_Click

DoCmd.SetWarnings False

    Dim stDocName As String

    stDocName = "qryUpdateRegrindOther"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

DoCmd.SetWarnings True


    Exit Sub

    MsgBox Err.Description
    Resume Exit_cmdUpdateRegrind_Click

End Sub

Open in new window

  • 3
  • 3
1 Solution
Rey Obrero (Capricorn1)Commented:

add these codes after running the query

docmd.gotorecord,, acnewrec
jeff-hAuthor Commented:
Thanks capricorn1!  It seems there's still an issue.  Do you think it's because the form is on a tab control?
Rey Obrero (Capricorn1)Commented:
is "frmGrindScrap" a subform ?

can you upload a .MDB copy of the app..
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

jeff-hAuthor Commented:
The main form is frmGrind, then there is a tab control (TabCtl0) with two tabs.  The subforms are unbound to the main form. To read a text box off of the form the code works out like this:


It's a huge mdb with a SQL backend.  If you think it will help I could upload both.

Rey Obrero (Capricorn1)Commented:
ok, use this then

docmd.gotorecord,, acnewrec
jeff-hAuthor Commented:
Excellent, thanks a million!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now