logo
search
Others

How to Add a Running Number Starting at Zero to a Microsoft Access Report

Maira MehtabMaira Mehtab Sep 28, 2026 869 views

Question details

The user wants to create a sequential record counter in a Microsoft Access report that begins at zero and increments by one for each detail record.

Product
Microsoft Access
Device & OS
not provided
Scenario
Designing an Access report where the detail records need a 0-based sequential index rather than the default 1-based index.
Observed behavior
By default, the Running Sum property starts counting at 1. The user needs a specific setup to force the displayed sequence to start at 0 without causing #Name? calculation errors.
Before you start

Ensure you have your Microsoft Access database open in Design View for the specific report you want to modify, and make sure the Property Sheet is visible on the right side of your screen.

Solution 1Recommended

Use a Hidden Counter and a Calculated Text Box

Create a hidden text box to track the standard running sum, and a visible text box that subtracts one to start the sequence at zero.

Microsoft Access does not natively support a 0-based running sum. Applying a Running Sum to a value of 0 will constantly yield 0. To work around this, you must calculate a normal 1-based running sum in the background and subtract 1 from it for display.

1
Add a Hidden Counter Text Box

Open your report in Design View. Add a new text box to the Detail section. In the Property Sheet, name this text box 'txtCounter'.

2
Configure the Running Sum Property

Set the Control Source of 'txtCounter' to '=1'. Then, change its Running Sum property to 'Over All' (or 'Over Group' if you want it to restart per category). Finally, set the Visible property to 'No'.

3
Add the Visible Display Text Box

Add a second text box to the Detail section where you want the zero-based running number to appear on your final report.

4
Set the Subtraction Formula

Set the Control Source of this visible text box to '=[txtCounter]-1'. Save your report and switch to Report View to verify the sequence.

Troubleshooting #Name? Errors: If the visible text box shows a '#Name?' error, ensure report grouping and sorting are not interfering. Verify that the hidden text box is exactly named 'txtCounter'. In rare cases where group sorts cause corruption, deleting and rebuilding the report resolves the error.
Free Microsoft Office alternative

Looking for a Lightweight Alternative for Data and Reports?

While Microsoft Access is used for complex database structures, you can manage structured data lists, track records, and create detailed reports easily using WPS Spreadsheet. WPS Office is a free, lightweight, and highly compatible alternative for your daily document needs.

Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Manage large datasets, filter records, and create professional pivot tables without complex database setups.Lightweight installation with a familiar, easy-to-use tabbed interface.Seamless migration of your data reporting tasks across Windows, Mac, and mobile devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my running sum text box show a #Name? error?

This error occurs if the visible text box references a control name that does not exist or is misspelled. Ensure your hidden text box is named exactly 'txtCounter' and that the formula is '=[txtCounter]-1'. Group sorting conflicts can also cause this, which might require removing the group sort or entirely rebuilding the report layout.

Can I reset the running number to zero for each new group in the report?

Yes. To restart the zero-based counter for each group, change the Running Sum property of the hidden 'txtCounter' text box from 'Over All' to 'Over Group'. The visible text box will automatically follow suit and restart at zero for every new group.

Why do I need two text boxes instead of just one?

Access requires the Running Sum property to be tied to a standard numeric counter (like =1). If you apply '=0' directly, the running sum will remain 0 indefinitely. By using a hidden text box to do the actual counting (1, 2, 3) and a second visible one to subtract 1, you trick the report into displaying the desired 0, 1, 2 sequence.