Highlight Only the Current Record in a Microsoft Access Continuous Form
Question details
The user wants a highlight box to appear only around the current record in an Access continuous form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A continuous form displays multiple records, including a checkbox in each row.
- Observed behavior
- A box control appears in every row because continuous forms repeat the same control layout for each record.
Identify the form's unique primary-key field and open the form in Design View. The example below uses frmOrders and RecordID; replace these names with the names in your form.
Use a Header Control and Conditional Formatting to Outline the Current Row
Use the current record's primary key to apply a visual outline only to the matching row.
A continuous form repeats its detail controls for every record, so changing a control's Visible property in the Current event affects all rows. Conditional formatting can evaluate an expression separately for each displayed record.
Access conditional formatting does not directly toggle a control's border. Instead, use thin text boxes as the four edges of an outline and conditionally change their background color.
In Design View, add an unbound text box to the Form Header. In its Property Sheet, set Name to txtCurrentID and Visible to No.
Select the form, open Property Sheet > Event, and choose Event Procedure for On Current. Click the build button and add the assignments to the Form_Current procedure: Me!txtCurrentID = Me!RecordID, followed by Me.Repaint on the next line. If a Form_Current procedure already exists, add the lines to it rather than creating a second procedure.
In the Detail section, add four thin unbound text boxes around the area to highlight. Set each text box's Control Source to ="", its Border Style to Transparent, and its normal background color to match the surrounding form background. Arrange the edges so they do not cover controls users need to click.
Select the edge text boxes and open Format > Conditional Formatting. Add an Expression Is rule using Not IsNull([RecordID]) And [RecordID]=Forms![frmOrders]![txtCurrentID], then choose a contrasting background color for the rule. Substitute your own field and form names.
Save the form and switch to Form View. Click controls in different records and check that the colored outline follows the current row. An unsaved new record without a primary key will not match the rule.

Work With Exported Access Data in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility. Export Access data to a spreadsheet to work with it in WPS; WPS does not replace Access forms or fix their conditional formatting.

Frequently Asked Questions
Why does my box appear on every record?
A continuous form repeats the Detail section's controls for every displayed record. Changing the box control's Visible property affects the repeated control, not just the current row.
Why store the current key in the form header?
The header control holds one value for the form. The conditional-formatting expression can compare each row's primary key with that value.
Can conditional formatting directly show a border?
Access conditional formatting does not directly toggle a control's border. You can simulate an outline with thin text boxes whose background colors change under an Expression Is rule.
What happens when a new record has no primary key yet?
The example rule excludes null keys, so it will not highlight that record until a key exists. If the key is assigned on save, update the header control in the form's After Insert event.




