search query null results

Matt Brown

Registered User.
Local time
Today, 12:43
Joined
Jun 5, 2000
Messages
120
Is it possible to stop a query running if no results were found in the search.

I have a form with a query behind it which i use to filter data from a search form.

If the query returns no data on to the search results form then instead of showing a blank form can it either display a message or return back to the main form.

Any help would be appreciated...

thanks

Matt
 
Private Sub Form_Open(Cancel As Integer)
If (RecordsetClone.RecordCount = 0) Then
DoCmd.Close
Beep
MsgBox "There is no information for that period.", vbInformation, "No Info Recorded"
End If
 
Thanks Rich,

Works just fine.

Matt
 

Users who are viewing this thread

Back
Top Bottom