Results 1 to 4 of 4
  1. #1
    virgilio is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2019
    Posts
    34

    Alternating color customization for continuous forms

    Hi, I would like to customize the colors that my continuous forms use for the alternating bands. I discovered that setting the 'On Paint' event for the 'Detail' section of my form in VBA is able to set the form background in alternating colors, but the cells seem to sit on top of the alternating stripes, unchanged.



    My VBA is:

    Code:
    Private Sub Detail_Paint()       
            Detail.BackColor = &HDDDDDD
            Detail.AlternateBackColor = &H8EAD00
    End Sub
    But the results are:

    Click image for larger version. 

Name:	alt_color1.PNG 
Views:	8 
Size:	10.4 KB 
ID:	42313



    How can I customize the cell colors in alternating rows?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,481
    Try setting control BackStyle to transparent.

    But why not just set AlernateBackColor property in design instead of VBA?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    virgilio is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2019
    Posts
    34
    Thanks June7, that's what I was looking for!

    I had tried this in 'Properties', but I tend to resort to VBA when that doesn't do what I want.

    I'm going to mark this as 'solved', but I don't understand why the control 'cells' stop responding to the colors that are set in Detail >> Back Color and Alternate Back Color when I change them off of 'Background 1'. Setting control backstyle to transparent fixes this, but it seems glitchy, especially because setting a different theme changes the color that 'Background 1' points to.

    Do you know how to change the theme settings in VBA?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,481
    I don't use Themes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Change color on textbox in a Continuous Forms
    By barby.pava in forum Forms
    Replies: 20
    Last Post: 03-30-2016, 08:01 AM
  2. Replies: 8
    Last Post: 11-28-2015, 12:00 PM
  3. Replies: 7
    Last Post: 03-04-2012, 05:08 PM
  4. Replies: 1
    Last Post: 11-02-2011, 03:15 AM
  5. Replies: 0
    Last Post: 10-24-2008, 11:20 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 - Senior Forums