Macros in Access 2000

  • Thread starter Thread starter Chuck Moore
  • Start date Start date
C

Chuck Moore

I have a form that displays several dtm controls that are
expiry dates for training certificates. I would like to
write a Macro (this is my first one) that will look at the
date in a control and if the date is less than to-day's
date (in other words the certificate has expired), I want
to change the backgound color of the control to light red
(12). In the Macro Builder I can find my way to OpenForm
and then GoToControl but I can't find the proper action to
allow me to write the code. I assume that the code would
be "if dtmRecertExDate<Date{},BackColor = 12"

Am I in the correct area? Can this be done with a Macro?
Should I be doing this in some other way?

Thanks,
 
Hi Chuck. If you are using Access 2000 or later, you can do this without
needing a macro or code.

1. In form design view, select the control.

2. Choose Conditional Formatting from the Format menu.

3. Set Condition 1 to:
Field Value Is less than Date()
and choose the color you want.
 
Back
Top