Dim dtStart As Date
Dim dtEnd As Date
Dim strDateRange As String
If IsNull(Me.date1.Value) Then
dtStart = #1/1/1900#
Else
dtStart = Me.date1.Value
End If
If IsNull(Me.date2.Value) Then
dtEnd = #1/1/2199#
Else
dtEnd = Me.date2.Value
End If
strDateRange = "(issuedate BETWEEN #" & dtStart & "# AND #" & dtEnd & "#)"
Me.Filter = strDateRange
Me.FilterOn = True
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
strDateRange = "(dateValue(issuedate) BETWEEN " & datevalue(dtStart) & " AND " & datevalue(dtEnd) & ")"
debug.print strDateRange ' this will print the formatted string, see if the dates are all in the same format
you can also try using
strDateRange="dateserial(y