How to Highlight Matching Fields in an Access Continuous Form
Question details
The user wants to visually highlight specific fields in a Microsoft Access continuous form based on the text entered in a search box.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Filtering and searching records within a continuous form interface.
- Observed behavior
- Dynamic highlighting needs to be applied to matching text while avoiding unwanted highlights when the search box is left empty or contains a zero-length string.
Ensure your Microsoft Access database is open in Design View and identify the exact control names for your search box and the fields you wish to highlight.
Apply Conditional Formatting with Search Validation
Use an expression-based conditional formatting rule on each control to dynamically highlight matches while explicitly ignoring empty search boxes.
Microsoft Access evaluates empty search boxes as potential wildcard matches. By adding a specific condition to your format expression, you can prevent the entire column from highlighting when no search term is entered.
Right-click your continuous form in the navigation pane and select Design View.
Click the specific field control (e.g., Model) that you want to highlight when its contents match the search query.
Navigate to the Format tab on the top ribbon and click 'Conditional Formatting', then select 'New Rule'.
Choose 'Expression Is' from the dropdown and input the following formula: CStr([Model]) Like "*" & Form.[SearchTextBox] & "*" And Not IsNull(Form.[SearchTextBox]).
Choose a distinct background fill color or font style for the highlighted cell, then click OK to save and apply the rule.

Reset the Search Box to Null Using VBA
Ensure the search box is completely cleared to Null instead of a zero-length string, preventing false triggers in your conditional formatting.
Looking for a Lightweight Office Alternative?
While Microsoft Access manages your complex databases, WPS Office is the perfect companion for your everyday document, spreadsheet, and presentation needs. It provides a comprehensive, lightweight toolkit for modern productivity.
- 1. Download the installer: Visit the official WPS website and click on the free download button.
- 2. Install WPS Office: Run the downloaded file and follow the quick on-screen instructions to set up the software.
- 3. Open existing Office files: Launch WPS Office and directly open your .docx, .xlsx, or .pptx files seamlessly without any format loss.

Frequently Asked Questions
Why are all fields in my Access form highlighted when the search box is empty?
This happens because an empty search string is often evaluated as a wildcard match for all text. Adding the condition `And Not IsNull(Form.[SearchTextBox])` to your conditional formatting expression prevents this behavior.
Can I apply one conditional formatting rule to highlight an entire row in a continuous form?
No, conditional formatting in Access is applied at the control level. You must apply the formatting rule separately to each individual text box or control that you want to highlight within the row.
What is the difference between Null and a zero-length string in Access searches?
Null represents the complete absence of any data, while a zero-length string ("") is technically a valid string that simply contains no characters. Resetting your search box to Null ensures expressions relying on `IsNull()` evaluate properly.




