On No Data

libby32

Registered User.
Local time
Today, 22:45
Joined
Mar 6, 2003
Messages
42
I have a form based on a query. Sometimes there may be no data in the query so the form opens up blank. How can I get a message box to come up saying "There is no data to update" instead of opening up a blank form and under what form event should I put this code??
 
Private Sub Form_Open(Cancel As Integer)
If (RecordsetClone.RecordCount = 0) Then
DoCmd.Close
Beep
MsgBox "There are no invoices recorded for that period.", vbInformation, "No Invoices Recorded"
End If

End Sub
 

Users who are viewing this thread

Back
Top Bottom