How To Highlight The Current Row In A Continuous Form In 3 Steps

Somebody asked this question, and so I wanted to show how to do it here. It is really simple.

As you may know, when you change the color for 1 row in a continuous form, every row will be affected! Not like Excel.

So how do you fix this?

Glad you asked…with VBA and conditional formatting.

So take a look….

1. Add a blank text box to your continuous form, and call it something like “txtBlank”.

2. Then add some VBA code to the current event of the form like this:

Private Sub Form_Current()
    Me.txtBlank = Me.CustomerID        
End Sub

3. Then just add some conditional formatting to change the background color of the text box when the current row is clicked:

When the Expression is [CustomerID]=[txtBlank] set the background to some color.

Just add the conditional formatting to the other fields and hide your blank field and you are good to go.

Let me know if you have any questions.






By the way, if you got or are getting value from the VBA information, please click the "Donate" button to give me a small token of your appreciation, thanks!


These posts may help answer your question too...

Learn Access VBA: Understand Tables, Queries, Forms, and Reports

Learn Access VBA: From Zero to Database Hero If you’ve ever opened Microsoft Access and wondered how all the pieces fit together — tables, queries, forms, and reports — this tutorial is made for you. In just a few minutes, you’ll understand how Access works behind the scenes and see how VBA (Visual Basic for […]

How to Fix Run Time Error 1004 in Excel

If you work with Microsoft Excel frequently, chances ar ling for a solution. Fortunately, this error is well-documented, and there are several ways to resolve it. In this article, we’ll explore the causes of run time error 1004, practical steps to fix it, and preventive measures to reduce the chances of it happening again. What […]

How To Make An Access Form Time Picker

Here is a relatively easy way to select times for your time entry text boxes. It’s a reusable form that allows you to pick a time from an Access form. There are probably different ways to do this but here is the way I would do it. On the form that has the time fields, […]

How To Parse A Flat File In Excel VBA

In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]


Support these sponsors:
Previous Post

How To Use The Value Of A Hidden Combo Box Column

Next Post

Peoplesoft To SAP Migration Via Access