I encountered a Type Mismatch error in the below line. Not sure how to best code this (error BOLDED). Please help.
Dim GCriteria As String
Dim strDate As String
If Len(Patient_Search) = 0 Or IsNull(Patient_Search) = True Then
MsgBox "You must enter a text to search."
Else
'Generate search criteria
GCriteria = cboSearchField.Value & " LIKE '*" & Patient_Search & "*'"
strDate = cboSearchDate.Value & " Between #" & Me.From & "# AND #" & Me.Thru & "#"
'Filter Referrals based on search criteria
Form_Referrals.RecordSource = "select * from [All Referrals Query] where " & GCriteria And strDate
Form_Referrals.Caption = "Referrals Search (" & cboSearchField.Value & " contains '*" & Patient_Search & "*')"
'Close Frm_Search
DoCmd.Close acForm, "Frm_Search"
MsgBox "Results have been filtered with part of patient's name within the date range (Blank = no match)."
End If