tags:

views:

92

answers:

1

I have a somewhat complicated looking Access Form with a continuous display (meaning multiple records are shown at once). I'd like to change the background color of the selected record only so the end-user can easily tell which record they are on.

I'm thinking of perhaps a conditional format or maybe something like this:

Private Sub Detail_HasFocus()
    Detail.BackColor(me.color)=vbBlue
End Sub

and something similar for when that row loses focus. This code snippet obviously won't work, but it's the kind of code I'd like to achieve.

A: 

Here is a sample from MVP Dev Ashish on coloring in continuous forms.

http://www.mvps.org/access/forms/frm0024.htm

Raj More
One point about Dev's solution is that it predates the implementation of conditional formatting. It also has the advantage over conditional formatting of not painting slowly (something that annoys me about conditional formatting).
David-W-Fenton
Agreed. I went with this solution. I still feel like I'm 'tricking' Access into doing what I want, but it works.
PowerUser
Continuous forms are very useful, but they do have their limitations because of the way they are implemented, i.e., each row is an instance of the same form, but not easily controllable independently (except for data-dependent conditions). I avoid editable continuous forms precisely because of these problems.
David-W-Fenton