Access VBA: Move to the Next Record Without Adding a Record
Question details
Move to the next existing subform record without entering a new record, while allowing additions through a dedicated button.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- An Access subform has Next and New Record buttons for navigating and adding records.
- Observed behavior
- The existing navigation code does not always work on the first click, and users should not enter a new record through the Next button.
Open the subform in Design View and confirm that its record source supports adding records. Locate the subform's Current event and the Click events for its Next and New Record buttons.
Control record additions with the subform's Current event
Use this approach to navigate existing records while allowing a new record only when the New Record button enables it.
In the subform's Property Sheet, open the Event tab and select [Event Procedure] for On Current. Click the build button and add this code to the event procedure: Private Sub Form_Current() Me.AllowAdditions = Me.NewRecord End Sub
Open the New Record button's On Click event procedure and enable additions before moving to a new record: Private Sub cmdNewRecord_Click() Me.AllowAdditions = True DoCmd.GoToRecord Record:=acNewRec End Sub Use the actual button name in the procedure declaration.
Open the Next button's On Click event procedure and handle an unavailable next record: Private Sub cmdNext_Click() On Error GoTo HandleError DoCmd.GoToRecord Record:=acNext Exit Sub HandleError: If Err.Number = 2105 Then MsgBox "No next record is available." Else MsgBox "Error " & Err.Number & ": " & Err.Description End If End Sub Use the actual button name in the procedure declaration.
Save the subform and open it in Form View. Click Next through the existing records, then click New Record and confirm that you can enter a record.

Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with documents, spreadsheets, and presentations. Its Office-format compatibility makes it easy to move everyday files between suites. It does not replace Microsoft Access or fix Access VBA forms.

Frequently Asked Questions
Why does the Next button stop at the last existing record?
The subform's Current event sets AllowAdditions to False on existing records, so Next cannot move into a new record. The button handles error 2105 when no next record is available.
How can users add a record if additions are disabled?
In the New Record button's On Click procedure, set Me.AllowAdditions = True, then run DoCmd.GoToRecord Record:=acNewRec.
Where should I put the Current event code?
Open the subform in Design View, select its Property Sheet, and choose [Event Procedure] for On Current on the Event tab. Add the code to the Form_Current procedure.
Why might the New Record button still fail?
Check that the subform's record source supports additions and that the database permits editing. Also confirm that the button's On Click property points to its event procedure.




