How to Highlight the Current Record in an Access Continuous Form
Question details
The user wants to highlight only the active record in a continuous form without changing the background color of all records simultaneously.

- 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.
Verify the primary key field name of your table, as it is required to accurately identify the active record for conditional formatting.
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.
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.
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.
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.

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. Download and Install: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Open Your Office Files: Launch WPS Office and open your existing Word, Excel, or PowerPoint documents with full formatting retention.
- 3. Start Creating: Enjoy a familiar tabbed interface to edit, format, and save your work instantly.

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.




