Hi,
I have a form based on a query which asks the user to enter a street name. I'd like to display a msg if there are no records matching that street.
Tried using this code from SJ McAbney in another thread but with no luck.
If DCount("[ID]", "qryYourQuery") = 0 Then
MsgBox "There is no data for the information you have entered.", vbInformation, "No Records Returned."
Exit Sub
Else
DoCmd.OpenQuery "qryYourQuery"
End If
Any suggestions would be appreciated.
I have a form based on a query which asks the user to enter a street name. I'd like to display a msg if there are no records matching that street.
Tried using this code from SJ McAbney in another thread but with no luck.
If DCount("[ID]", "qryYourQuery") = 0 Then
MsgBox "There is no data for the information you have entered.", vbInformation, "No Records Returned."
Exit Sub
Else
DoCmd.OpenQuery "qryYourQuery"
End If
Any suggestions would be appreciated.