conditional format based on comparing 2 dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need help on my form please.

I need to format the "ActualCompletedDate" to red and bold if it is later
than "ShouldBeCompletedDate", else keeps normal and black color. Both fields
are Date and input by users.

Thanks in advance!
Huaqin
 
Hi, Huaqin.

Use Format, ConditionalFormatting from form design view. Select the
formatting you desire for your condition, select "Expression Is" from the
combo box, and enter a valid boolean expression. Use the entire object
specifier rather than the shortcut Me!. I'm not sure why, but in my version
this doesn't work.

In your case, something like:

Forms![yourformname]![ActualCompletedDate]>Forms![yourformname]![ShouldBeCompleteDate]

You may also want to add an OR expression in case ActualCompletedDate is not
filled in, so that it turns red also if today's date is greater than
ShouldBeCompleteDate.

HTH
Sprinks
 
Thanks much, Sprinks. It works perfectly.

Sprinks said:
Hi, Huaqin.

Use Format, ConditionalFormatting from form design view. Select the
formatting you desire for your condition, select "Expression Is" from the
combo box, and enter a valid boolean expression. Use the entire object
specifier rather than the shortcut Me!. I'm not sure why, but in my version
this doesn't work.

In your case, something like:

Forms![yourformname]![ActualCompletedDate]>Forms![yourformname]![ShouldBeCompleteDate]

You may also want to add an OR expression in case ActualCompletedDate is not
filled in, so that it turns red also if today's date is greater than
ShouldBeCompleteDate.

HTH
Sprinks


Huaqin said:
Hi,

I need help on my form please.

I need to format the "ActualCompletedDate" to red and bold if it is later
than "ShouldBeCompletedDate", else keeps normal and black color. Both fields
are Date and input by users.

Thanks in advance!
Huaqin
 
Back
Top