I have a created a search engine on a form in access. When the search command button is hit, it filters all records that matches the criteria given, and opens a form in read only mode, with all the filtered records. There is a point where a user can enter a date into a textfield and search by that date, but there is an error, the debugger indicates an error:
"the open form action was canceled"
The rest of the search works fine, the error occurs when a date is inputted.
This is the code that creates a sql statement to filter the records:
If Not IsNull(Me.Text116) Then
If criteria <> "" Then
criteria = criteria & " AND "
End If
criteria = criteria & "datefrom = '" & Me.Text116 & "'"
End If
Here is the command to open the form:
DoCmd.OpenForm "viewMain", , , criteria
Please help!
"the open form action was canceled"
The rest of the search works fine, the error occurs when a date is inputted.
This is the code that creates a sql statement to filter the records:
If Not IsNull(Me.Text116) Then
If criteria <> "" Then
criteria = criteria & " AND "
End If
criteria = criteria & "datefrom = '" & Me.Text116 & "'"
End If
Here is the command to open the form:
DoCmd.OpenForm "viewMain", , , criteria
Please help!