MS access highlight row in continuous form

Highlight selected records in continuous form

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:

  1. Create a table with at least two fields.
    • SN (which contains the AutoNumber.
    • Any other text field.
  2. 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.
  1. On the current Event of the form. Click On Current and select Code Builder. Paste the following VBA code:
  1. Highlight all fields within the details of the form and select Conditional Formatting. It’s located in the Format Tab of the ribbon.
  2. Select New Rule.
  3. Select “Expression Is” and paste the following expression formula:

          *You might need to insert the correct field names according to your form.

  1. 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.