Hi guys,
I have a "Yes/No" control on a form. When it is selected I need the forms background colour to change to red. Can somebody point me in the right direction please?
Hi guys,
I have a "Yes/No" control on a form. When it is selected I need the forms background colour to change to red. Can somebody point me in the right direction please?
Use code like this in the click or after update event for your control
Replace control name and colors with your ownCode:if me.chkcontrolname=true then Me.Detail.Backcolor=vbBlue Else Me.Detail=vbCyan End if
You can use RGB values if you wish e.g. RGB(100,100,100) for one of 255 shades of grey (not 50)
Great thanks, that works on the form.
Next question is I also have a navigation form which i used the built in menu to design. This navigation form is set as the default form to open when the database is opened. On selecting this particular form using the navigation form and I scroll through the listings, the control is selected but the background colour doesn't change.
I never use navigation forms as they can be awkward to modify.
Try adding that code in Form_Current event as well
Last edited by isladogs; 01-26-2018 at 07:04 AM.