logo
search
Formatting Issues

How to Highlight the Current Record in an Access Continuous Form

Phi Hung VoPhi Hung Vo Sep 28, 2026 869 views

Question details

The user wants to highlight only the active record in a continuous form without changing the background color of all records simultaneously.

How to Highlight the Current Record in an Access Continuous Form
Product
Microsoft Access
Device & OS
not provided
Scenario
Navigating and editing data within an Access continuous form while synchronizing related subforms.
Observed behavior
Changing the background color in the OnCurrent event incorrectly applies the highlight to every record displayed on the continuous form, rather than just the active one.
Before you start

Verify the primary key field name of your table, as it is required to accurately identify the active record for conditional formatting.

Solution 1Recommended

Use Conditional Formatting with a Custom IsSelected Function

This method uses VBA to store the active record's ID and applies a conditional formatting rule to highlight only the currently selected row.

In Access, setting a control's property via VBA applies to the entire column. By using Conditional Formatting alongside a custom VBA function, you can bypass this limitation and target only the row that matches the stored record ID.

1
Create the IsSelected Function

Open the VBA editor (Alt + F11). Create a public function named IsSelected that compares the current record's primary key ID with the form's Tag property.

2
Update the Form's OnCurrent Event

In the form's Design View, open the Property Sheet. Under the Event tab, add a VBA macro to the OnCurrent event that sets 'Me.Tag' to the current record's ID, followed by 'Me.Refresh' or 'Me.Repaint' to update the interface.

3
Apply Conditional Formatting

Select the text boxes you want to highlight on the continuous form. Go to Format > Conditional Formatting, select 'Expression Is', enter 'IsSelected()', and choose your desired background highlight color.

Use Conditional Formatting with a Custom IsSelected Function
Selection Restored: This approach ensures that when the selection changes, the new active record gets highlighted, and the previous record's formatting is restored to normal.
Free Microsoft Office alternative

Need a Free Alternative for Your Everyday Office Tasks?

While WPS Office does not include a direct database management tool like Microsoft Access, it offers a powerful, free alternative for Word, Excel, and PowerPoint. If you are looking to cut down on expensive Office subscriptions for your document editing, spreadsheets, and presentations, WPS Office is a lightweight and highly compatible solution.

  1. 1. Download and Install: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Open Your Office Files: Launch WPS Office and open your existing Word, Excel, or PowerPoint documents with full formatting retention.
  3. 3. Start Creating: Enjoy a familiar tabbed interface to edit, format, and save your work instantly.
Seamless compatibility with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight installation and blazing fast startup speeds.Free to use with a familiar, easy-to-navigate user interface.Smooth migration for your everyday office files without data loss.
QA img-9

Frequently Asked Questions

Why does changing the background color in the OnCurrent event affect all records?

In an Access continuous form, modifying a control's property via VBA (like BackColor) applies to the control's design definition, which is repeated for every record. It does not apply independently to individual rows unless handled via Conditional Formatting.

Does the Me.Refresh command in the OnCurrent event cause screen flickering?

Frequent refreshing can sometimes cause slight screen flickering on forms containing many records or complex subforms. You can try using Me.Repaint instead, which only updates the visual state without requerying the database.

Can I highlight the active record without using VBA code?

No, Access requires at least a small amount of VBA (like capturing the active record's ID into a hidden text box or the form's Tag property) combined with Conditional Formatting to uniquely identify and highlight the current row.