I've got a form with a start date and an end date field that I'm trying to use to apply a filter to a sub form. I used a snippet of code from the FAQ that looks like:
When I click the 'Apply Filter' button I get a "Type mismatch" error which then highlights:
I can't see anywhere that I don't have the field types set up incorrectly. Any other ideas as to where this error might be coming from?
Code:
strFilter = "" 'Start with a blank filter
'Verify the both ends of the start date range are valid
If (IsDate(Me![txtStartDate]) & IsDate(Me![txtEndDate])) Then
'Build the filter
strFilter = "([DateAdded] between #" _
& Me![txtStartDate] & "# AND #" _
& Me![txtEndDate] & "#)"
When I click the 'Apply Filter' button I get a "Type mismatch" error which then highlights:
Code:
If (IsDate(Me![txtStartDate]) & IsDate(Me![txtEndDate])) Then
I can't see anywhere that I don't have the field types set up incorrectly. Any other ideas as to where this error might be coming from?