use calendar control in unbound form

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

Guest

I have a query that reads a date field:

Between [Forms]![pickdate]![fromdate] And [Forms]![pickdate]![todate]

The fromdate and todate values come from a calendar control in an unbound
form. However, the todate is not inclusive as there are missing records. Any
ideas would be great.
 
Hi,


Add 1 to todate since by default, the time is, say, at 00:00:00 as in July
17, 2006 at 00:00:00. So, July 17, 2006, 06:00:00 is AFTER the limit you
supplied. Adding 1 (day = 24 hour) correct the situation.

Between [Forms]![pickdate]![fromdate] And CDate([Forms]![pickdate]![todate])
+ 1



Hoping it may help,
Vanderghast, Access MVP
 
Thanks for the prompt reply, Michael.

The query formula makes sense but still does not work. Funny thing is the
query returns all records if I use a textbox to capture the fromdate and
todate.

I checked the properties in the calendar box but did not see any relevant
paramenter.


Michel Walsh said:
Hi,


Add 1 to todate since by default, the time is, say, at 00:00:00 as in July
17, 2006 at 00:00:00. So, July 17, 2006, 06:00:00 is AFTER the limit you
supplied. Adding 1 (day = 24 hour) correct the situation.

Between [Forms]![pickdate]![fromdate] And CDate([Forms]![pickdate]![todate])
+ 1



Hoping it may help,
Vanderghast, Access MVP

Walter said:
I have a query that reads a date field:

Between [Forms]![pickdate]![fromdate] And [Forms]![pickdate]![todate]

The fromdate and todate values come from a calendar control in an unbound
form. However, the todate is not inclusive as there are missing records.
Any
ideas would be great.
 
Back
Top