You need to tell Access where or what #[SuppressDate]# is.
I find your code difficult to read.
I have a free routine called SmartIndenter and I ran your code though it to get this reformatting
Code:
Private Sub btnsrch_Click()
Dim MedID As String
Dim SuppressDate As Date
' Get Value from Medicaid_ID textbox on the Form:
Me.btnsrch.SetFocus
Me.SrchMed_ID.SetFocus
MedID = Me.SrchMed_ID.text
Dim Msg, Style, Title, MyString '<-----these are variants by default
Dim Response As Integer
If IsNull(DLookup("[Medicaid_ID]", "Returned_Mail", "Medicaid_ID = '" & SrchMed_ID & "'")) Then
DoCmd.OpenForm "RA_Tracking", , , , acFormAdd
Me.SrchMed_ID = ""
Else
If (DCount("[Medicaid_ID]", "Returned_Mail", "Medicaid_ID = '" & SrchMed_ID & "'" & _
"And Not Nz([SuppressDate])")) Then 'what do you expect from NZ
'maybe you meant IsNull()
DoCmd.OpenForm "RA_Tracking", , , "Returned_Mail.Medicaid_ID = '" & SrchMed_ID & "'"
Me.SrchMed_ID = ""
Else
Response = MsgBox("Is the RA a Refund with a $0.00 balance with an RA Date prior to " & Format([SuppressDate], "mm/dd/yyyy") & " (date will be set-up tp auto populate later, click 'No' and compare RA Date to Suppress Date)" & vbNewLine & vbNewLine & "If RA Date is prior to the Suppress Date = Recycle; otherwise log RA and give to Lisa", vbYesNo) 'added 12/11/2014
If Response = vbYes Then 'added 12/112014
MsgBox ("Do not log RA's for this Medicaid ID:" & (Chr(13)) & (Chr(13)) & " " & [SrchMed_ID] & (Chr(13)) & (Chr(13)) & "Recycle this providers RA's")
Me.SrchMed_ID = ""
ElseIf Response = vbNo Then
DoCmd.OpenForm "RA_Tracking", , , "Returned_Mail.Medicaid_ID = '" & SrchMed_ID & "'"
Me.SrchMed_ID = ""
End If
End If
End If
End Sub
Where is SuppressDate??
Do you have a clear concise description of what this code is trying to accomplish?
I recommend you test incrementally to get piece to work, and then progressively add more details/complexity.
Good luck with your project.