no data handling

legendv

Registered User.
Local time
Today, 19:36
Joined
Mar 18, 2002
Messages
99
Does anyone know how to close a form if no data is found upon opening?
 
In the OnOpen event of the form you can check to see if there are any records to display. If not, you can cancel the Open event.

Sample code:

Code:
Private Sub Form_Open(Cancel As Integer)
    If Me.RecordsetClone.RecordCount = 0 Then
        Cancel = True
    End If
End Sub

Hope this helps.

SteveA
smile.gif
 
thanks steve!
 

Users who are viewing this thread

Back
Top Bottom