Ms Access Forms Go To New Record after confirmation form runs

Posted on 2011-10-12
Last Modified: 2012-05-12

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

Question by:jeff-h
    LVL 119

    Expert Comment

    by:Rey Obrero

    add these codes after running the query

    docmd.gotorecord,, acnewrec

    Author Comment

    Thanks capricorn1!  It seems there's still an issue.  Do you think it's because the form is on a tab control?
    LVL 119

    Expert Comment

    by:Rey Obrero
    is "frmGrindScrap" a subform ?

    can you upload a .MDB copy of the app..

    Author Comment

    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.

    LVL 119

    Accepted Solution

    ok, use this then

    docmd.gotorecord,, acnewrec

    Author Closing Comment

    Excellent, thanks a million!

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now