Results 1 to 5 of 5
  1. #1
    Join Date
    May 2009
    Posts
    41

    Unanswered: How to change background color of all forms?

    There are about 30 forms in this Access db, and the background color isn't very nice. Is there a way to change them all at the same time?

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    You could write some code to loop through, but I really think in the long run that you'd save a lot more time just picking a color and applying it to all the forms manually.

    Unless you wanted to let your user pick their own color, then you might consider writing code to do it. If that were the case I'd insert some code to run when a form opens to check a table for a long value and apply that to the form's color property.
    Me.Geek = True

  3. #3
    Join Date
    May 2009
    Posts
    41
    Quote Originally Posted by nckdryr
    You could write some code to loop through, but I really think in the long run that you'd save a lot more time just picking a color and applying it to all the forms manually.

    Unless you wanted to let your user pick their own color, then you might consider writing code to do it. If that were the case I'd insert some code to run when a form opens to check a table for a long value and apply that to the form's color property.
    Thanks, nckdryr... I like the idea of letting the user pick the color.

  4. #4
    Join Date
    Feb 2002
    Posts
    108
    I let my users pick the color. When they login it looks up their colors.

    Each form runs the following code in the On_Load code:

    For popup forms---
    FormHeader.BackColor = Forms!switchboard!ColorHeaderPop
    Detail.BackColor = Forms!switchboard!ColorBodyPop
    FormFooter.BackColor = FormHeader.BackColor

    For subforms---
    FormHeader.BackColor = Forms!switchboard!ColorHeaderSub
    Detail.BackColor = Forms!switchboard!ColorBodySub
    FormFooter.BackColor = FormHeader.BackColor

    For main forms---
    FormHeader.BackColor = Forms!switchboard!ColorHeader
    Detail.BackColor = Forms!switchboard!ColorBody
    FormFooter.BackColor = FormHeader.BackColor

    I have another form that the user can go to that is just a bunch of colored text boxes with no text in them that the user can click on to choose that color and it puts the number value of the color in a usercolor table.

  5. #5
    Join Date
    May 2005
    Posts
    1,191
    As I recall there's a Color dialog box in the commdlg.dll file that will let your users pick a color from the standard interface for windows.

    Here it is, try this code from Microsoft out.
    Me.Geek = True

Posting Permissions

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