[AccessD] Color Field on Continuous Form based on Field Value

David Emerson newsgrps at dalyn.co.nz
Sat Sep 24 22:24:06 CDT 2022


Hi Gustav,

Thanks for the link.  I appreciate you using the NZ flag in you demo 😊

I like your idea of creating the BMP files on the fly.  Do you have any code for doing this?

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand



-----Original Message-----
From: AccessD <accessd-bounces+newsgrps=dalyn.co.nz at databaseadvisors.com> On Behalf Of Gustav Brock via AccessD
Sent: Sunday, 25 September 2022 10:36 am
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Cc: Gustav Brock <gustav at cactus.dk>
Subject: Re: [AccessD] Color Field on Continuous Form based on Field Value

Hi David

You could write a tiny 1 x 1 pixel BMP file on the fly from a skeleton, only exchanging the three RGB bytes..
It is only 58 bytes starting with BM:

000102030405060708090A0B0C0D0E0F
--------------------------------
424D3A00000000000000360000002800
00000100000001000000010018000000
00000400000000000000000000000000
000000000000BE927000

Here, the BGR colours to modify are the three bytes BE 92 70, in Access displayed as #7092BE.

Then, bind the created BMP files to a picture control on the form.
That can be done as shown in my article:

GustavBrock/VBA.PictureUrl: Download and display pictures directly from URLs (github.com)<https://github.com/GustavBrock/VBA.PictureUrl>

/gustav


Fra: David Emerson<mailto:newsgrps at dalyn.co.nz>
Sendt: 24. september 2022 21:43
Til: AccessD<mailto:accessd at databaseadvisors.com>
Emne: [AccessD] Color Field on Continuous Form based on Field Value

Hi Listers,

I am familiar with using Conditional Formatting to color a field based on a fixed list of colors.

I have a continuous form where the user selects a different color for each record using the color picker and storing the color value in a field.  This color value is then used elsewhere in the program.

This means that the color can be any of hundreds of possible colours.

What I would like to do is have the background of the field (or something
else) colored in the color so the user can see what colors have been chosen across all the records showing on the continuous form.  Does anyone know a way of doing this?

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand

--
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list