Results 1 to 9 of 9
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Highlight Current Record (Many Versions)

    I often want to highlight the current row in a continuous subform. Typically this is where I have linked subforms, and I want users to be clear about which record is current.

    I use what I think is one of the standard methods for highlighting the current record.

    In the form header I have a hidden textbox (txtcurrentID) and the oncurrent event sets this textbox to the ID field of the record.
    I have a disabled textbox behind the other controls, and I use conditional formatting to set its background colour, based on the value in txtcurrentID.

    Every now and then I find that this method produces intolerable screen flicker on some computers (never on my computers though). Yesterday I had an example on two computers where each I time I changed the record on the main subform, the screen would flicker for about 15 seconds before finally settling down.
    It is so bad I am going to completely remove the row highlighting- When I do that the problem disappears.

    Has anyone else had this problem? Does using a different method of row highlighting solve it?

    I attach a demo of my method.
    Attached Files Attached Files
    Regards
    John



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlight Current Record (Many Versions)

    I've seen problems with screen flicker when using a technique like this on slow PCs.

    For a simple subform with only one bound text box, you could try removing the disabled background text box, and change the background color of the bound text box in a conditional format with "Field Has Focus" as condition. You don't need the hidden text box or the code for it. Perhaps this will speed up.

    Something else you could try is adding a line

    Me.Recalc

    near the end of the On Current event procedure of the subform (above Exit Sub); this forces Access to recalculate immediately instead of leasurely.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Highlight Current Record (Many Versions)

    Thanks Hans

    Your suggestion of using the "field has focus" condition is exactly what I have done on the two problem computers, as a temporary solution.

    I will see whether adding Me.Recalc makes any difference next time I go there.
    Regards
    John



  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Highlight Current Record (Many Versions)

    Just an additional observation about Highlighting the Current Row that had me puzzled until recently.

    Conditional Formatting, be default, sets enabled to True, unless you explicitly set it to do otherwise.
    So if you apply a conditional format to a disabled text box, the text box becomes enabled. I found people could click on the "blue background" and it came to the front, and hid the data they were supposed to see.

    To prevent this happening click the enabled button in the conditional format dialog.
    Attached Images Attached Images
    Regards
    John



  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Highlight Current Record (Many Versions)

    I don't know if it will help, but when I first developed a technique for highlighting a row in a continuous form, it was for Access97 and did not use conditional formatting. I'm not sure whether this will have any affect on the "flicker" problem, but there is a demo of this technique on my website (see below) if you want to try it.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlight Current Record (Many Versions)

    Hi Mark,

    Your method would also cause screen flicker on slow PCs, but it's alleviated by the line

    Me.Recalc

    in the On Current event of the form. That's why I suggested using Me.Recalc higher up in this thread. I may very well have learned that trick from you!

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Highlight Current Record (Many Versions)

    >>Your method would also cause screen flicker on slow PCs, but it's alleviated by the line: Me.Recalc<<

    Thanks, I don't remember whether or not I used Me.Recalc or not; I'll have to digout the code! I also vaguely remember that flicker seemed related to the size of the recordset in the subform, but this also may have been more of a function of the machine speed (since when I first devised the technique some 10 years ago, machines were a tad slower than they are now).

    I haven't used this in ages. I guess because I now often use datasheets since the user can more easily customize them (change order of columns, resize them, change fonts, etc.), and I have routines that save/apply these configurations. It was very useful, however, in situations where I had side-by-side subforms, where say the right subform was contingent upon a value in the left subform; it made it easier to visually "connect" the two subforms.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlight Current Record (Many Versions)

    Yes, you do have Me.Recalc!

  9. #9
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Highlight Current Record (Many Versions)

    >>Yes, you do have Me.Recalc!<<

    Hans,

    Yes, I see that I did. Usually I hate looking at code I wrote years ago, especially several generations of Access ago. It is almost a little embarassing ("Oh my God! Did I actually write that? What was I thinking?"). But this technique seems to have held up; I guess because it was actually rather simple (once you understand it). Besides, it is always fun when people say "You can't do that with Access!", but you can say "Yes you can!"!
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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