Conditional Format and Checkbox Control

Chief

Registered User.
Local time
Yesterday, 23:32
Joined
Feb 22, 2012
Messages
156
Hello,
I have a form with a check box. When the Check box is true I have coded for the Header to turn red. as below. The properties for the header back colour is #22B14C

If Me.AccountOnHold = True Then
Me.FormHeader.BackColor = vbRed
Else: Me.FormHeader.BackColor = RGB(34, 177, 76) see note
End If

'rgb conversion for #22B14C'

It works no problem, however when I close and reopen the form the header has returned to the form property of green, being 'back color #22B14C.
The check box is still true or ticked. How do I maintain the state of the form when the check box is ticked or not.
Thank you in advance.
 
Presumably you have that code in the after update event of the checkbox. It would also need to be in the current event to handle changing records and when the form loads.
 
Presumably you have that code in the after update event of the checkbox. It would also need to be in the current event to handle changing records and when the form loads.

My apologies, yes it is in the After Update section of the Check Box.
I'm using Access 2010. and I am a newb....
In regards to the "Current event" is that the 'Before Update'?

Thank you for prompt response.
 
No, it's an event of the form itself, not the checkbox. It would say "On Current" in the form properties.
 
pbaldy,
Your a champion, thank you so much it was doing my head in.
 
Happy to help, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom