How to Apply Conditional Formatting When Another Text Box is Null in Access
Question details
The user wants to format a specific text box in Microsoft Access conditionally based on whether another text box is null or empty.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up conditional formatting rules on forms or reports in MS Access.
- Observed behavior
- The user needs a formatting rule applied to one control only when a second associated control lacks data (is null).
Identify the exact control names of both the text box you want to format and the text box you need to check for a null value by opening your Access Form or Report in Design View.
Use an Expression in Conditional Formatting
Apply an expression-based rule to check if the target control meets your criteria while the other control is null.
Microsoft Access allows you to format a control based on the values of other controls on the same form or report by using the 'Expression Is' condition.
Right-click your form or report in the navigation pane and select 'Design View'.
Click on the text box (e.g., txtBoxA) that you want to apply the formatting to.
Navigate to the 'Format' tab on the ribbon and click on 'Conditional Formatting'.
Click 'New Rule'. Under the condition type dropdown, select 'Expression Is'.
Type your expression, for example: [txtBoxA] > 5 AND [txtBoxB] Is Null. Replace the sample names with your actual control names.
Choose the desired font color, background color, or styling to apply when the condition is met, then click 'OK'.

Looking for a Free, Lightweight Office Suite?
While Microsoft Access handles complex databases, most everyday data management, conditional formatting, and analysis can be easily accomplished in WPS Spreadsheet. WPS Office is a highly compatible, free alternative to Microsoft Office that supports your daily document, spreadsheet, and presentation needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
- 2. Install and Launch: Follow the simple installation prompts and open WPS Spreadsheet to manage your data.
- 3. Apply Conditional Formatting: Easily set up complex formatting rules for your data sheets using the intuitive Conditional Formatting menu in the Home tab.

Frequently Asked Questions
Why isn't my conditional formatting working when checking for an empty string?
An empty string ("") is different from a Null value in Access. If your field might contain empty strings instead of being completely null, update your expression to check for both conditions: [txtBoxB] Is Null OR [txtBoxB] = "".
Can I apply this rule to multiple text boxes at once?
Yes, you can hold down the 'Ctrl' key while clicking multiple text boxes in Design View, then open the Conditional Formatting rules manager to apply the same expression-based rule to all selected controls simultaneously.
How do I find the actual control name of my text box?
In Design View, select the text box and press F4 to open the Property Sheet. The actual control name is listed at the very top under the 'Name' property on the 'Other' or 'All' tab.




