I am trying to allow users to filter a set of records by date. My reference to the filter control is as follows:
If Nz(Me.DateFilter, 0) > 0 Then 'TargetType
If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
strFilter = strFilter & "#Date# = '" & Me.DateFilter & "'"
bFilter = True
End If
Where DateFilter is the unbound control and Date is the field on the form to be filtered.
I have used both text and numerical filters such as this successfully before, and understand the differences in syntax there. But I obviously have the syntax wrong for the date data type, and a couple of hours of experimenting and searching online for help have not produced a solution. Thank you in advance for guidance.
If Nz(Me.DateFilter, 0) > 0 Then 'TargetType
If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
strFilter = strFilter & "#Date# = '" & Me.DateFilter & "'"
bFilter = True
End If
Where DateFilter is the unbound control and Date is the field on the form to be filtered.
I have used both text and numerical filters such as this successfully before, and understand the differences in syntax there. But I obviously have the syntax wrong for the date data type, and a couple of hours of experimenting and searching online for help have not produced a solution. Thank you in advance for guidance.