Conditional Format

S

SAC

If I use conditional formating on a control how would I make all the
controls for that record a certain background color. I'm using a continuos
form.

Or can I do this on a report?

The control I'm looking on is the number of days between two dates and I
want to make the background either green, yellow, or red based on the number
of days.

Can I do this in a report easier?

Thanks.
 
W

Wayne Morgan

This can be done with a form or report. Open the form or report in design
mode, right click the desired control, and choose Conditional Formatting.
Set the desired condition and format(s). If you try to do this in code on a
continuous form, all rows will change, not just the current row. Conditional
formatting will do this separately for each row.

To get the entire row to display with a different background, you have two
options.
1) Set the conditional formatting for each control in the row so that each
one will changes its back color.
2) Set the back ground of each control to Transparent. Place a new textbox
across the entire row. Set it to Locked = Yes and Enabled = No. This one
should NOT have a transparent back ground. Set the Conditional Formatting on
this textbox. You will need to choose Expression Is from the drop down
option in the Conditional Formatting dialog then enter and equation that
gives the value you want from the date difference textbox. When you are done
setting all of the Conditional Formats for this textbox, go to the Format
menu on the menu bar and choose Send To Back to put it behind the other
controls in that row. Since the other controls have transparent backgrounds,
the color from this new textbox will show through.
 

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