VBA & Macro Problems

Access VBA: Move to the Next Record Without Adding a Record

Bushra ParveenBushra Parveen Nov 25, 2026 868 views

Question details

Move to the next existing subform record without entering a new record, while allowing additions through a dedicated button.

Move to the Next Record Without Adding a Record in Access VBA
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.
Before you start

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.

Solution 1Recommended

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.

1
Set the Current event

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

2
Configure the New Record button

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.

3
Configure the Next button

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.

4
Test both buttons

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.

Control record additions with the subform's Current event
Record availability: Error 2105 can occur when Access cannot move to the requested record, including when there is no next record. The form and its record source must also permit additions for the New Record button to work.
Free Microsoft Office alternative

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.

Organize tabular data in WPS SpreadsheetsOpen and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for common Office tasksMove everyday Office files to a free, lightweight suite
microsoft office alternative - wps office

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.