Results 1 to 3 of 3
  1. #1
    bell is offline Advanced Beginner
    Windows 7 64bit Access 2002
    Join Date
    Feb 2015
    Posts
    37

    Alternating Row Colors for Subform in Access 2002

    Hi all,

    I've been doing a little research on this subject and cannot find anything I need for Access 2002.

    I have a subform that displays info in datasheet view, and I would like to have the colors alternating for each row of the subform, so when I print the report out its a little easier to follow the table.

    I found info about about using Alternate Back Color, but I can't find this field in Access 2002.



    Can anybody help me with this one?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    it's not available in access 2003.

    I do not know if this will work on a form (it does on reports)

    Create a field on your form with the control source =1, name the field LineNumber, set the property to RUNNING SUM
    Open your form
    You should see a field with an incremental number.

    If that works
    create a text box that covers your detail area, send it to the back, and put conditional formatting on that field of

    EXPRESSION:

    [LineNumber] mod 2

    Select the color you want for the alternate row from the back color palette.

    Open your form again, if it works like a report you should see alternate row shading.

    If the running sum is not available on forms (I don't think I remember it being so) you can artificially create a linenumber using this:

    http://www.tek-tips.com/faqs.cfm?fid=5248

    except you would be using a static value (1) instead of summing a value.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by rpeare View Post

    ...I do not know if this will work on a form (it does on reports)...

    ...if it works like a report you should see alternate row shading.

    ...If the running sum is not available on forms...
    Since the OP stated
    Quote Originally Posted by bell View Post

    ...I would like to have the colors alternating for each row of the subform, so when I print the report out its a little easier to follow...
    I don't see where there's a reason to be concerned with doing this on the Form; colors displayed on a Form should have nothing to do with colors displayed on a Report, as Forms should never be printed out!

    This being said, rpeare's code, if intended for Reports, as stated, should work just fine!

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA for Access chart colors
    By Tcurtis in forum Programming
    Replies: 6
    Last Post: 08-27-2014, 11:42 AM
  2. Alternating colors in a report
    By 97rstd in forum Reports
    Replies: 6
    Last Post: 07-29-2014, 02:14 AM
  3. Replies: 20
    Last Post: 10-25-2013, 06:16 AM
  4. Change row-colors i subform datasheet view
    By rolfmagne in forum Forms
    Replies: 1
    Last Post: 03-02-2011, 11:07 AM
  5. Replies: 1
    Last Post: 12-30-2005, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums