Open form if query has results

Pusher

BEOGRAD Put
Local time
Today, 11:08
Joined
May 25, 2011
Messages
230
Hi all,
How do i make a form open on a event (on Load of another form) if a query has results?(the form that opens displays the results) If there is a need for it then it opens, if there is no results then it does nothing.
Thanks
 
I would open the form that is feeding off the query and put the following code in it's On Load event;
Code:
    If Me.Recordset.RecordCount = 0 Then
        MsgBox "No Records For That Criteria"
        DoCmd.Close
    End If
If there are no records to display the user only sees the message box.
 

Users who are viewing this thread

Back
Top Bottom