Code:
Private Sub Blank1_Click()
DoCmd.OpenQuery "Query1", acViewNormal '<<-- opens a saved query
'Me.RecordsetClone.RecordCount gets the record count of the current FORM,
' NOT the query record count!!
If Me.RecordsetClone.RecordCount = 0 Then '<<-- ME is a reference to the active form
MsgBox "No Items for this selection."
Else
MsgBox "Selection is good."
End If
DoCmd.Close acQuery, "Query1"
End Sub
Try this
Code:
Private Sub Blank1_Click()
Dim r As DAO.Recordset
Dim RC As Long '<<-- record count
Set r = CurrentDb.OpenRecordset("Query1")
r.MoveLast
MsgBox r.RecordCount
RC = r.RecordCount
If RC = 0 Then
MsgBox "No Items for this selection."
Else
MsgBox "Selection is good."
End If
r.Close
Set r = Nothing
End Sub