Sorry, wasn't sure how to phrase the question but here's the situation:
I have a form that allows a user to apply a variety of filters to a report. One of the filters is a date range where user can enter either start date, or start/end date to confine the range. In the table that is bound to the report the date field is formatted mm/dd/yyyy.
In the code on the form I am using the following:
So here's my question: is it possible to change the code in such a way that the user has more flexibility with the date format? So that one could type in either 5/23/2002 to start searching from that specific date OR just 2002 to search for the entire year?
I'd love for the user to type in start date 2002 end date 2003 and get all the values between 1/1/2002 and 12/31/2003. OR type in 2002 and get all records from 1/1/2002 to the present.
Is that possible? Thanks for any help.
I have a form that allows a user to apply a variety of filters to a report. One of the filters is a date range where user can enter either start date, or start/end date to confine the range. In the table that is bound to the report the date field is formatted mm/dd/yyyy.
In the code on the form I am using the following:
Code:
Const conJetDate = "\#mm\/dd\/yyyy\#" 'and later If Me.txtStartDate > "" Then strDate = strDate & " AND ([Field Obs Date] >= " & Format(Me.txtStartDate, conJetDate) & ")" End If If Me.txtEndDate > "" Then strDate = strDate & " AND ([Field Obs Date] < " & Format(Me.txtEndDate + 1, conJetDate) & ")" End If
I'd love for the user to type in start date 2002 end date 2003 and get all the values between 1/1/2002 and 12/31/2003. OR type in 2002 and get all records from 1/1/2002 to the present.
Is that possible? Thanks for any help.
Comment