if the form is in SingleForm view (shows one record at a time), run the code
from the combo box's AfterUpdate event, and the form's Current event, as
If Me!ComboBoxName = "sold" Then
Me!LabelName.BackColor = vbGreen
Else
Me!LabelName.BackColor = vbRed
End If
you can use any of the VB color constants, or you can use a numeric value to
display any shade of any color you choose.
note that if your form is set to ContinuousForms view, the code will act
according to the control's value in the current record, but will change the
label color in every rcord displayed in the form. if you're using A2000 or
newer, you can get around that by changing the label to an unbound textbox
control, and using the Conditional Formatting option, found in form design
view under Format on the menu bar.
hth
"charlotte" <(E-Mail Removed)> wrote in message
news:8F18E2CD-9794-40C2-A772-(E-Mail Removed)...
> I would like to cause the back color of the label of a combo box on a form
to
> change color after selecting one of two choices: 'sold' and 'unsold'. I
have
> tried to write an event procedure but am new to vba and have had no
success.
> I would very much like some advice
> --
> charlotte
|