I have tried this code linked to a button that seems to work, however i am now getting records that i know are in the database but for some reason it doesnt seem to like the date field and just brings back a blank screen. When i go into design view on the form and theck the filter through properties, it shows the full filter but wont show the information on screen. Its very confusing, again can anybody help
Private Sub Command8_Click()
Dim strFilter As String
Dim strMsg As String
'Check to ensure atleast one criteria has been entered. If not then provide an error message
' telling the user to enter at least one piece of criteria
If IsNull([protech]) And IsNull([Episode_Date]) And IsNull([ICP_Code]) Then
strMsg = MsgBox("No ICP Information!", vbCANCELOnly)
Exit Sub
End If
strFilter = ""
If Not IsNull(Me!protech) Then
strFilter = strFilter & "[protechnic_number]= " & Chr(34) & Me!protech & Chr(34) & " AND "
If Not IsNull(Me!Episode_Date) Then
strFilter = strFilter & "[Episode_Date]= " & "#" & Me!Episode_Date & "#" & " AND "
If Not IsNull(Me!ICP_Code) Then
strFilter = strFilter & "[icp_code]= " & Me!ICP_Code
End If
End If
End If
DoCmd.OpenForm "frmSpecificAssesment", , , strFilter
End Sub