[AccessD] Alternating background color in continuous forms?

A.D.Tejpal adtp at touchtelindia.net
Tue Nov 16 06:13:38 CST 2004


Christopher,

    You can see my sample db named HighLightDatasheetRows at Rogers Access Library (other developers section). Link - 
http://www.rogersaccesslibrary.com

    This db demonstrates two styles of highlighting - (i) Current Row and (ii) Alternate Rows. Some interesting features are -

    (a) Anchor Row - In both alternatives, user can pinpoint any row as an anchor row (if desired), by double clicking on it. The anchor row gets highlighted in a special color and continues in this state, till some other row is pinpointed as the new anchor row. If any existing anchor row is to be put back to normal (without pinpointing a new one), simply double click it again.
    
    (b) - In case of alternate row highlighting, the form, on opening, has color on odd rows. For replacing it with color on even rows, simply double click on any even numbered row. For reverting back to color on odd numbered rows, double click on any odd numbered row.

    Note - The technique used is completely non-obtrusive. It does not need any special field (e.g. Yes/No or counter etc) to be added to the source table. No updating or editing of any bound control is involved. No label or unbound text box is used. Only requirement is that the source table should have a field holding unique values.

    You might like to adapt the underlying approach suitably for your specific needs. (The arrangement demonstrated for datasheets is applicable to continuous forms as well). 

Regards,
A.D.Tejpal
--------------

  ----- Original Message ----- 
  From: Christopher Hawkins 
  To: accessd at databaseadvisors.com 
  Sent: Wednesday, November 10, 2004 09:05
  Subject: [AccessD] Alternating background color in continuous forms?


  Greetings, all!

  I want to do something kind of fun.  I am trying to figure out how to do alternating background colors in a continuous form.  I was looking at conditional formatting in Access 2002, but am not sure how to work out an expression that will do the trick.

  I am also looking a doing it programmatically, but I think I'd have to do some heavy subclassing, which isn't worth the work just for eye candy.

  Surely someone must have done this before.  Can anyone either offer sugestons on how to figure it out, or post actual code?  I'll be sure to give proper credit when it's time to submit the results to the UI Hall of Fame.  ;)

  -Christopher-
  Respectfully,

  Christopher Hawkins
  Software Developer
  (559) 687-7591
  http://www.christopherhawkins.com



More information about the AccessD mailing list