I have a form with a control with numerical options 1-6. Depending on which number is selected in that control I want the background color of the entire form to change. Is that possible?
I have a form with a control with numerical options 1-6. Depending on which number is selected in that control I want the background color of the entire form to change. Is that possible?
in your option table, put optn# & color code:
1, 255
2, 4344566
3, 7556343
the combo will contain both columns ,but the user need only see 1 so set widths:
.5;0
then when user picks the item in combo, set the color:
me.Detail.BackColor = cboBox (if col 2 is bound)
if col1 is bound to combo:
me.Detail.BackColor = cboBox.columns(1) 'in vba columns begin with 0
these go in the AFTERUPDATE event:
Code:sub cboBox_Afterupdate()me.Detail.BackColor = cboBox end sub
I guess there's no way to do it via Conditional Formatting?
Not possible using conditional formatting. Textboxes and combos can be modified using CF but not other controls nor whole forms
You have to use code
I've don the following using SINGLE FORM MODE. I added a unbound text box control that covered the detail section. I sent it to the back and sent all of the controls to the front.
I used CF to look at a specific control and set the BG of the text box using "Expression Is". Add as many rules as necessary.
In this example the detail section BGis Green. Enter 5 and the text box switches to Yellow. I have 3 conditions =5, <5 and >5.
In a continuous form, I added a text box that was bound to a boolean field so that if the field was TRUE, the text box BG would change. This was to high light which records were selected. If you use an UNBOUND text box in a continuous form.....
well, try it and see what happens.
Kinda clunky, but it might give you some ideas......
That works amazingly. Very simple too. Thanks!I've don the following using SINGLE FORM MODE. I added a unbound text box control that covered the detail section. I sent it to the back and sent all of the controls to the front.
I used CF to look at a specific control and set the BG of the text box using "Expression Is". Add as many rules as necessary.
In this example the detail section BGis Green. Enter 5 and the text box switches to Yellow. I have 3 conditions =5, <5 and >5.
In a continuous form, I added a text box that was bound to a boolean field so that if the field was TRUE, the text box BG would change. This was to high light which records were selected. If you use an UNBOUND text box in a continuous form.....
well, try it and see what happens.
Kinda clunky, but it might give you some ideas......
Happy to help....