logo
search
Others

How to Keep Access Forms Sorted After Selecting Records

Rana GarciaRana Garcia Oct 9, 2026 869 views

Question details

The user needs to maintain the custom date-based sort order in an Access form after executing a Select All or Deselect All action.

How to Keep Access Forms Sorted After Selecting Records
Product
Microsoft Access
Device & OS
not provided
Scenario
Using custom buttons to select or deselect records, which triggers UPDATE statements on the form's data.
Observed behavior
The form loses its date-based sort order and resets to default after the buttons are clicked, likely due to a Requery command or an ORDER BY clause.
Before you start

Before editing your VBA code or form properties, ensure you create a backup copy of your Access database to prevent accidental data or logic loss.

Solution 1Recommended

Remove Unnecessary Requery Commands in VBA

Prevent the form from reloading its recordset and clearing the user's sort order by removing or commenting out the Requery command.

The most common cause of losing interactive sort orders is the use of the Requery method. Because your UPDATE statements only modify existing records without inserting or deleting them, requerying the entire recordset is usually unnecessary.

1
Open the form in Design View

Launch your Access database, navigate to the Navigation Pane, right-click the form experiencing the sorting issue, and select 'Design View'.

2
Access the VBA editor

Right-click the 'Select All' or 'Deselect All' button and select 'Build Event' to open the VBA editor for the button's Click event.

3
Locate the Requery command

Scroll through the VBA code to find the 'Me.Requery' or similar requery command that executes after your UPDATE statements.

4
Comment out the Requery line

Add an apostrophe (') at the beginning of the Requery line to comment it out (e.g., 'Me.Requery). Save your changes and test the form.

Remove Unnecessary Requery Commands in VBA
Alternative to Requery: If you need to show the updated data on the screen without losing the sort order, consider using 'Me.Refresh' instead of 'Me.Requery'. Refresh updates existing records but does not reload the entire dataset.
Free Microsoft Office alternative

Looking for a Lightweight Alternative for Daily Office Tasks?

While Microsoft Access handles complex databases, WPS Office is the perfect free alternative for your daily document, spreadsheet, and presentation needs. It is lightweight, fast, and fully compatible with major office formats.

  1. 1. Visit the WPS website: Go to the official WPS Office website to find the latest version.
  2. 2. Download the installer: Click the 'Free Download' button to download the setup file for your operating system.
  3. 3. Install and launch: Run the downloaded installer, follow the simple on-screen instructions, and launch WPS Office to start working.
100% free and lightweight office suiteSeamless compatibility with Microsoft Office formats (.docx, .xlsx, .pptx)Familiar and intuitive tabbed interfaceBuilt-in PDF editing and conversion tools
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access form reset its sort order when I click a button?

This typically happens if the button's VBA code contains a Requery command. Requerying forces the form to reload its entire recordset from the database, which drops any custom sort orders or filters applied by the user.

What is the difference between Requery and Refresh in Access?

Requery reloads the entire recordset, capturing new or deleted records but resetting user filters and sorts. Refresh only updates the data in the existing records currently being displayed, keeping your interactive sort order and position intact.

How can I sort an Access form using VBA without losing user settings?

You can set the form's OrderBy property in VBA (e.g., Me.OrderBy = "DateDesc") and then set Me.OrderByOn = True to apply a specific sort programmatically without requerying the whole dataset.