F
Frustrated query user.
I am passing date values from text boxes on forms into
query criteria. The field name in the query is:
"Critical Date: CDate(DateAdd("d",-[DaysNotice],
[EndDate]))". [EndDate] is a date and DaysNotice is an
integer.
The query criteria for [Critical Date] is:
"Between [Forms]![inpfrmReport]![txtBeginDate] And
[Forms]![inpfrmReport]![txtEndDate]". [txtBeginDate] and
[txtEndDate] are both formatted as dates.
When I remove the above criteria line from the query, it
returns the one record it is supposed to. And, when I
hard code the Begin and End Dates in the criteria
(Between #1/1/2005# And #12/31/2005#) it also returns the
matching record. BUT, when I leave the Form.Control path
above, the record DOES NOT RETURN. Several variants of
the above have been tried, such as "#" & before and after
each control name, and nothing seems to work. Can someone
please help me understand this problem and get around it??
Thank you in advance.
query criteria. The field name in the query is:
"Critical Date: CDate(DateAdd("d",-[DaysNotice],
[EndDate]))". [EndDate] is a date and DaysNotice is an
integer.
The query criteria for [Critical Date] is:
"Between [Forms]![inpfrmReport]![txtBeginDate] And
[Forms]![inpfrmReport]![txtEndDate]". [txtBeginDate] and
[txtEndDate] are both formatted as dates.
When I remove the above criteria line from the query, it
returns the one record it is supposed to. And, when I
hard code the Begin and End Dates in the criteria
(Between #1/1/2005# And #12/31/2005#) it also returns the
matching record. BUT, when I leave the Form.Control path
above, the record DOES NOT RETURN. Several variants of
the above have been tried, such as "#" & before and after
each control name, and nothing seems to work. Can someone
please help me understand this problem and get around it??
Thank you in advance.