Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2008
    Location
    Virginia, USA
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Code to change report font to nonstandard color

    I am using Select Case to alter forecolor of fields in a report based on the outcome of a calculated query field. If I use vbRed, no problem. How do I refer to a nonstandard color such as gray?

  2. #2
    New Lounger
    Join Date
    Oct 2013
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ColorContants :

    vbBlack, vbBlue, vbCyan, vbGreen, vbMagenta, vbRed, vbWhite, vbYellow...

    you can also use RGB format:

    interior.color = RGB(xxx,xxx,xxx)
    or
    font.color = RGB(xxx,xxx,xxx)

    What exactly are you invoking?

    Shades of Grey in RGB:

    192,192,192
    128,128,128
    150,150,150
    100,100,100
    Last edited by ThinkSpaceSolutions; 2013-11-01 at 16:48.

  3. #3
    WS Lounge VIP Browni's Avatar
    Join Date
    Dec 2009
    Location
    Rochdale, UK
    Posts
    1,650
    Thanks
    38
    Thanked 161 Times in 139 Posts
    Here's an example from of a very old report I did (1995!)

    Private Sub Detail_Format(Cancel As Integer, PrintCount As Integer)
    If Me!PrintFlag1 Or Me!PrintFlag2 Then
    Me![CD Title].BackColor = 12632256
    Else
    Me![CD Title].BackColor = 16777215
    End If
    End Sub
    It still works today.

    You can find the Access code numbers for different colours here

    Obviously you can change .BackColor for whichever colour attribute you wish.

Posting Permissions

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