Comparing a date field with today's date

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

Guest

My report contains a date field 'Delivered_On' and a label 'lbl_Sited'; both
have the visible format set to no.

I am trying to get the date field to become visible if the date is greater
than today's date, and the label to become visible if the date field is less
than today.

When I use the argument "If Me.Delivered_On >= Now() Then.....", I get an
error "You entered an expression that has no value"
 
I would use only text boxes and no code. Set the control sources to something
like:

=IIf([Delivered_On] > Date(), [Delivered_On], Null)
=IIf([Delivered_On] > Date(), Null, "Sited Caption")
 
Duane - worked first time. Very many thanks for your time and input.
--
Keith W


Duane Hookom said:
I would use only text boxes and no code. Set the control sources to something
like:

=IIf([Delivered_On] > Date(), [Delivered_On], Null)
=IIf([Delivered_On] > Date(), Null, "Sited Caption")

--
Duane Hookom
Microsoft Access MVP


Keith Woollacott said:
My report contains a date field 'Delivered_On' and a label 'lbl_Sited'; both
have the visible format set to no.

I am trying to get the date field to become visible if the date is greater
than today's date, and the label to become visible if the date field is less
than today.

When I use the argument "If Me.Delivered_On >= Now() Then.....", I get an
error "You entered an expression that has no value"
 
Back
Top