Null Query with Message in Form (1 Viewer)

joeserrone

The cat of the cul-de-sac
Local time
Today, 06:55
Joined
Dec 17, 2006
Messages
164
Hello Everyone!
I have a form that is populated by a query, I would like the form to display a message to the user if the query produces NO results possibly On Load, and also I would like it to display a message when it reaches the end of the records produced

Thanks
 
R

Rich

Guest
Private Sub Form_Open(Cancel As Integer)
If (RecordsetClone.RecordCount) = 0 Then

MsgBox "There are no records to view"
DoCmd.Close acForm, Me.Name
End If
End Sub
 

Users who are viewing this thread

Top Bottom