Navyguy
Registered User.
- Local time
- Today, 18:25
- Joined
- Jan 21, 2004
- Messages
- 194
A few days ago Wayne helped me out (thanks alot again!!) using a Nz(DCount..) to search for null fields. Now I am trying to modify the code to do the same but using multiple fields. I have read my references and searched but have not had too much luck. I think I am supposed to use the AND function in the code but now I get compile errors.
Here's the code, and as always, appreciate the help
If Nz(DCount("[Incident Report Number]", _
"[Tbl-Resident Surnames]", _
"[Incident Report Number] = '" & Me.[Incident Report Number] & "'"), 0) = 0 AND ("[Surname]", _
"[Tbl-Resident Surnames]", _
"[Surname] = '" & Me.[Surname] & "'"), 0) = 0
AND ("[Residence Location]", _
"[Tbl-Incident Details Resident]", _
"[Residence Location] = '" & Me.[Residence Location] & "'"), 0) = 0 Then
MsgBox "There Is No Incidents That Match Your Entries", vbOKOnly, "Invalid Search Criterion!"
Me.[Incident Report Number].SetFocus
Exit Sub
End If
Navyguy
Here's the code, and as always, appreciate the help
If Nz(DCount("[Incident Report Number]", _
"[Tbl-Resident Surnames]", _
"[Incident Report Number] = '" & Me.[Incident Report Number] & "'"), 0) = 0 AND ("[Surname]", _
"[Tbl-Resident Surnames]", _
"[Surname] = '" & Me.[Surname] & "'"), 0) = 0
AND ("[Residence Location]", _
"[Tbl-Incident Details Resident]", _
"[Residence Location] = '" & Me.[Residence Location] & "'"), 0) = 0 Then
MsgBox "There Is No Incidents That Match Your Entries", vbOKOnly, "Invalid Search Criterion!"
Me.[Incident Report Number].SetFocus
Exit Sub
End If
Navyguy