Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    60
    Thanks
    1
    Thanked 1 Time in 1 Post

    Row Highlighting in Datasheet View (Access 2013)

    When I view the data in a table or the results of a query in datasheet view, Access highlights the current row in blue. If I click into a particular cell it de-highlights that cell but the remainder of the row is still highlighted.

    The same is true when viewing a form or sub-form in datasheet view.

    Is there any way to either (a) turn off this behaviour completely or (b) change the colour that Access uses to highlight the row?

    The reason I'm asking is that I have a number of datasheet sub-forms in a particular part of the application I'm working on, and these use Access's conditional formatting to highlight certain rows. The application, which is quite old (its origin pre-dates Access 2013 by quite a way), uses two different shades of blue (as well as one other colour) to highlight the rows which need highlighting. I use two shades of blue rather than two distinctly different colours because they mean the same thing, but the darker one indicates a higher "level" of the condition that I'm highlighting.

    And Access's blue row-highlighting colour is sufficiently close to one of the blues to make it confusing.

    Obviously I can change the colour I'm using, but it's something that people have become familiar with, over more than ten years in some cases, and it would also mean sending out new instructions, updating documentation and so on. Clearly, if it's possible, changing Access's behaviour could be an easier option. Is it possible?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,653
    Thanks
    3
    Thanked 65 Times in 64 Posts
    Would the trick posted by Marshall Barton in the MS Answers thread Highlight row in Continuous Form solve your problem? Putting a text box behind the controls and making them transparent lets you control the color of the highlighted row.
    Wendell

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    60
    Thanks
    1
    Thanked 1 Time in 1 Post
    Thanks for the suggestion, Wendell, but I can't see how I could accomplish that in datasheet view. There's no way of overlaying (or rather underlaying, in this case) one cell over/under others is there?

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,474
    Thanks
    1
    Thanked 41 Times in 40 Posts
    The tip Wendell gave you is something I've been using for many years, but as you found out it is only useful for continuous forms, not datasheets. You would have to use conditional formatting on every control.

    Perhaps you can put a column (perhaps at beginning of a row) and use conditional formatting on that 1 control? Set TabStop=False so it won't get focus. It's a work-around, but it might give you what you need.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    60
    Thanks
    1
    Thanked 1 Time in 1 Post
    Quote Originally Posted by MarkLiquorman View Post
    Perhaps you can put a column (perhaps at beginning of a row) and use conditional formatting on that 1 control? Set TabStop=False so it won't get focus. It's a work-around, but it might give you what you need.
    Sorry, Mark, I can't quite see what you're getting at here, I'm struggling to follow this. Can you explain a bit further?

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,474
    Thanks
    1
    Thanked 41 Times in 40 Posts
    I was just theorizing that there may be another way to highlight the situation on each line other than trying to shade the entire line. If you shaded just a single control in the line and made it so that control couldn't get focus (one of your complaints on conditional formatting), it still might present the user with the visual feedback that is needed.

    So just use conditional formatting like you wanted, but only on that single control.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  7. The Following User Says Thank You to MarkLiquorman For This Useful Post:

    SwissGolden (2017-10-14)

  8. #7
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    60
    Thanks
    1
    Thanked 1 Time in 1 Post
    Oh, I see what you mean. Sorry, I was being a bit slow on the uptake. I think once we get into the realms of overtly changing the application's behaviour / look and feel then I may as well just make the simplest change of all, which would be to stop using two shades of blue and instead use two shades of green - or whatever other colour I pick on - and inform people of the changes, update the documentation and so on.

    I did come up with a solution of my own yesterday evening, but it has its own drawbacks, so I'm not sure if I'm going to go down that route. But I'll describe it here, just for the record.

    The basis of this solution is that Access highlights your current datasheet row in blue, except where you have conditional formatting, then it leaves the colouring alone. Although it's not actually that dark a shade, I'll refer to this colour as "dark blue" from now on simply because it's the darker of the two shades of blue that are appearing, my other highlighting colours being light blue and amber.

    So... if I change the default background colour to dark blue, remove the conditional formatting rule which changes the rows to dark blue and instead insert a new conditional formatting rule which changes the background colour to white when none of the three highlight conditions are present, then the end result looks exactly as it should. If the current record is one of the dark blue records, Access does make it look a slightly darker blue, but no-one would be confused by this. This isn't because my dark blue and Access's dark blue are slightly different. I set my background colour to the colour Access had previously used to highlight the white background cells but under the new formatting, Access makes it darker still, though not by much.

    Under the existing system, I'd estimate that most of the time no more than 1 record in 10 gets highlighted by the conditional formatting. I don't know the exact figures, let's say that of those which are conditionally-formatted, six in ten would be dark blue, two in ten light blue and the other two in amber. So 6% of the total number of records are highlighted in dark blue; 2% in light blue; 2% in amber and the other 90% left as the default.

    If I make this change we end up with 90% highlighted in white; 2% in light blue; 2% in amber and only 6% left as the default.

    This is the thing that's making me wonder if it's a good solution. Clearly Access paints the conditional rows twice, you can see as much as you scroll, and in my situation that's now 94% of all the rows. Where there were fewer rows or where a higher proportion were already highlighted it may make less difference.

  9. The Following User Says Thank You to SimonC For This Useful Post:

    SwissGolden (2017-10-14)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •