Highlighting the current record of a continuous form makes it very clear to process functions especially if you have a huge list of records. The following steps, however, will guide you to the easiest way to highlight the current record within a continuous form. You can also download our sample for better clarifications:
- Create a table with at least two fields.
- SN (which contains the AutoNumber.
- Any other text field.
- After creating the continues form. Create Unbound Text Box. Name it “txtSelectedRecord” or any name of your choice. However, you have to amend the below VBA Code according to the name of the unbound text-box.
* The unbounded text-box can be set as hidden.
- On the current Event of the form. Click On Current and select Code Builder. Paste the following VBA code:
- Highlight all fields within the details of the form and select Conditional Formatting. It’s located in the Format Tab of the ribbon.
- Select New Rule.
- Select “Expression Is” and paste the following expression formula:
*You might need to insert the correct field names according to your form.
- Choose the preferred formatting and press OK.
VBA Code
Private Sub Form_Current()
Me.txtSelectedRecord = Me.SN
End Sub
Expression
[SN]=[txtSelectedRecord]
For more pro MS Access Programs, please visit our home page here.