I have the following code in the click event of a button
on a form:
If Nz(DCount("*", "qrySearchName"), 0) < 1 Then
MsgBox "record not found"
Exit Sub
Else
DoCmd.OpenQuery "qrySearchName"
End If
The query has this:
in one of the field area I have this
[tblmusic]![First_Name] & " " & [tblmusic]![Last_Name]
then in the critria I have:
Like "*" & [First And/Or Last Name] & "*"
How can I get a message box to come up if My query turns out null telling me their is no value?
on a form:
If Nz(DCount("*", "qrySearchName"), 0) < 1 Then
MsgBox "record not found"
Exit Sub
Else
DoCmd.OpenQuery "qrySearchName"
End If
The query has this:
in one of the field area I have this
[tblmusic]![First_Name] & " " & [tblmusic]![Last_Name]
then in the critria I have:
Like "*" & [First And/Or Last Name] & "*"
How can I get a message box to come up if My query turns out null telling me their is no value?