Colours glorious colours

Pennie

Registered User.
Local time
Today, 23:04
Joined
Aug 21, 2002
Messages
11
Hi all,

Is it possible to change the colour of various controls in a form via VBA code or a macro? My idea is to set up a setting form whereby the user will select background and foreground colours (ideally there should be a colour picker but I'll just give user a few options) so that the colour he/she picks will be stored in the settings table and then the program will read the table and adjust its colours accordingly. I can do that individually but haven't been able to work out a global change colour thingy.

I'm sure someone has asked this befoer but I can't find that thread.

Utterly gratful for any help

;)
 
Cut this code from a form I use to set the appearance of a button.

Private Sub Caption1()

If Forms![service form]![caldate subform]![Hol1] < CurrentDate Then
Insert1.Caption = "Update Required"
Insert1.FontBold = True
Insert1.ForeColor = 0

Else

Insert1.Caption = "Update not Required"
Insert1.FontBold = False
Insert1.ForeColor = 4194432


End If

End Sub

I'm sure you could use .forecolor = [your reference field]


Also found this in the VB help

look up backcolor

Me!txtPastDue.BorderColor = lngRed
Me!txtPastDue.ForeColor = lngRed
Me!txtPastDue.BackColor = lngYellow


getting your color picker may be more of a challenge but yes, it's possible.



HTH
Dave
 
Last edited:
colors

thanks v much, will try
 

Users who are viewing this thread

Back
Top Bottom