Conditional Formating

G

george

Hi,

Is it possible using conditional formating to set the
ForeColor property of a combobox depending on the value of
another combobox on the same form?

thanks in advance, george
 
R

Rob Oldfield

if me.cbo1="whatever" then
me.cbo2.forecolor=vbred
else
me.cbo2.forecolor=vbblue
endif

You'll want that in the after update event of cbo1 and, if it's a single
form, then in the current event of the form so that the format is set when
you move from record to record.
 
M

Marshall Barton

george said:
Is it possible using conditional formating to set the
ForeColor property of a combobox depending on the value of
another combobox on the same form?


As long as you can live with the limit of three conditions,
yes. Just use the Expression Is option instead of Value Is.

As Rob said, this is only really needed on a continuous or
datasheet form. Code is more versatile for a single view
form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top