Colour change

  • Thread starter Thread starter George
  • Start date Start date
G

George

Hi all

I have a database that stores the date that an ID card was issued

when I access the form containing the members detail I would like the

colour to change if the ID card is more than 11 months old suggesting
that

a new card is required within the next few weeks

the existing colour is black I would like it to turn red



George
 
George

Assuming that you wish this for each member's record as it is displayed,
you'd need to either add code to the form's OnCurrent event that evaluates
that field compared to what Date() returns (i.e., today's date). You can
change the BackColor or the text's color property if >11 months.

You might also check into the Conditional Formatting feature, to see if you
could do the evaluation there.
 
Hi all

I have a database that stores the date that an ID card was issued

when I access the form containing the members detail I would like the

colour to change if the ID card is more than 11 months old suggesting
that

a new card is required within the next few weeks

the existing colour is black I would like it to turn red

George


Don't you mean >= 11 months?

If you have Access 2000 or later, you can set a control's conditional
formatting property:
Click on the control you wish to change the color of.
Then click
Format + Conditional Formatting
Set the Condition1 drop-down to
Expression Is
In the control alongside the drop-down write:

DateDiff("m",[YourDateField],Date())>=11

Set the colors as wanted.
 
Back
Top