Show all dates if user does not enter a date range

  • Thread starter Thread starter Sierras
  • Start date Start date
S

Sierras

Hello

I have an unbound control which allows users to input some parameters
to search for data. One of them is a date range. Something like
this;

between [Forms]![Search Form]![txtStartDate] and [Forms]![Search
Form]![txtEndDate]

This works very well when users fill in the parameters as well as the
date range. However, the report comes up empty if the users do not
enter a date to search for.

I would like that the reports brings back all dates if the field is
left empty. In the other search fields, I've used a control like
this:

Like "*" & [Forms]![Search Form]![Search1] &"*"

This works well for text and number fields. But not for dates.
Anyone know how to get around this for dates??

Thanks
 
Anyone know how to get around this for dates??
Try

= NZ([Forms]![Search Form]![txtStartDate], #1/1/100#)
and <= NZ([Forms]![Search Form]![txtEndDate], #12/31/9999#)
 
John Vinson said:
Anyone know how to get around this for dates??
Try

= NZ([Forms]![Search Form]![txtStartDate], #1/1/100#)
and <= NZ([Forms]![Search Form]![txtEndDate], #12/31/9999#)
Neat. As a professor of mine used to say, the only thing wrong with it is
that I didn't think of it.
 
Back
Top