The reason your filter code errors is that you removed the 5 characters " AND " (in RED below) that must be at the end of the 3 lines.
Code:
Private Sub cmdFilter_Click()
'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter.
Const conJetDate = "\#mm\/dd\/yyyy\#" 'The format expected for dates in a JET query string.
Dim strWhere As String 'The criteria string.
Dim lngLen As Long 'Length of criteria string.
'Text field. Use Like to find anywhere in the field.
If Not IsNull(Me.txtProcedureName) Then
strWhere = strWhere & "[SurgicalProcedure] Like ""*" & Me.txtProcedureName & "*""" & " And "
End If
'Date field. Use the format string to add the # delimiters and get the right international format.
If Not IsNull(Me.txtDateFrom) Then
strWhere = strWhere & "[ProcedureDate] >= " & Format(Me.txtDateFrom, conJetDate) & " AND "
End If
'Date field.
If Not IsNull(Me.txtDateTo) Then
strWhere = strWhere & "[ProcedureDate] < " & Format(Me.txtDateTo + 1, conJetDate) & " AND "
End If
'See if the string has more than 5 characters (a trailing " AND ") to remove.
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then 'Nothing in the string
MsgBox "No Criteria", vbInformation, "Nothing to do."
Else 'Yes: there is something there, so remove the " AND " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging. Prints to Immediate Window (Ctrl+G)
Debug.Print strWhere
'Apply the string as the form's filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
Also comment out or delete the code in the module "ProcedureFilterCode"