none
Set background of a fields color by the Fields Value in each record. (will use RGB number) RRS feed

  • Question

  • Can someone tell me how to set the field background color by the field, or another fields value in each Record?  Example in photo(colors are not same as field value just an example)


    Thursday, April 18, 2019 9:16 PM

All replies

  • Can someone tell me how to set the field background color by the field, or another fields value in each Record?

    Hi Henry,

    If you want to set the background color in continuous forms per record, then it is practical not possible. The colouring goes per column, unless you use the very limited possibilities of Conditional Formatting.

    In unbound forms, combined with VBA code, the possibilities are almost endless, like next example:

    So, what goal do you have?

    Imb.

    Thursday, April 18, 2019 9:48 PM
  • I have some 550 different color codes i'd like to display in 550 different records.  second column has color # 3rd column would be it's color.

    I would like any field to display the color in each record.

    Lavender-DK 206 148 186 CE94BA  
    Name RED GRN BLU #RGB
    blanc White 255 255 255   FFFFFF
    Lavender-VY DK 148 91 128   945B80
    Lavender-DK 206 148 186   CE94BA
    Lavender-MD 236 207 225   ECCFE1
    Lavender-LT 243 218 228   F3DAE4

    • Edited by HenryDoc Thursday, April 18, 2019 10:13 PM
    Thursday, April 18, 2019 10:12 PM
  • I have some 550 different color codes i'd like to display in 550 different records.  second column has color # 3rd column would be it's color.

    I would like any field to display the color in each record.

    Hi Henry,

    It seems to me that this is about the same as my example.

    You can make a main form containing as many subform controls as you want to have columns (as I did). In the subforms you place the unbound controls, and fill them with the relevant information. This can be done in a very systematic way using VBA. A last subform could contain additional information on the selected color.

    But you can also make subforms with with colorname, colorcode, backcolor etc "aligned" in different controls, and this in a subform control.

    There are many possibilities, and it is al up to you to choose "your" best one. But all go back to unbound subforms with VBA code.

    Imb.


    • Edited by Imb-hb Friday, April 19, 2019 8:34 AM typo
    Friday, April 19, 2019 7:48 AM
  • You can use an unbound form for a limited set of colours using WithEvents as described in my article:

    Create Windows Phone Colour Palette and Selector using WithEvents

    A full demo is included.


    Gustav Brock

    Friday, April 19, 2019 10:39 AM
  • Hi HenryDoc,

    If you want to show 550 different background colors on a Continuous type form you have two options -

    You can use OLE Object type controls, see Continuous Type Form demo here If you are not a member of the UtterAccess forum you will need to join to be able to download the demo but it is free.

    If you are using Access 2007 or later you can use Rich Text type controls on the form and some code to show the background colors.

    Peter Hibbs.

    Monday, April 22, 2019 8:01 AM
  • I registered, and am not able to open the attachments there.  That site is the most difficult thing I've ever seen to navigate.  

    Tuesday, April 23, 2019 2:20 PM
  • It's a zip file. Just download it and open it as any other zip file.

    Gustav Brock

    Tuesday, April 23, 2019 2:29 PM