L legendv Registered User. Local time Today, 21:34 Joined Mar 18, 2002 Messages 99 May 29, 2002 #1 Does anyone know how to close a form if no data is found upon opening?
SteveA Registered User. Local time Tomorrow, 06:34 Joined Oct 8, 2001 Messages 126 May 30, 2002 #2 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
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
L legendv Registered User. Local time Today, 21:34 Joined Mar 18, 2002 Messages 99 May 30, 2002 #3 thanks steve!