Derek Brown
asked on
Has Data
Can I find out if a form HasData before I try to open it ?
I have tried this
If Me.Forms!AppointmentsAll.H asData = -1 Then
DoCmd.OpenForm "AppointmentsAll"
End If
It doesn't work
Derek
I have tried this
If Me.Forms!AppointmentsAll.H
DoCmd.OpenForm "AppointmentsAll"
End If
It doesn't work
Derek
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also use the Form_Open event to determine whether there are any records in the form.
Private Sub Form_Open(Cancel As Integer)
Cancel = (Me.RecordsetClone.RecordC ount = 0)
End Sub
However, if you use this technique, you will need to handle the error that occurs when you cancel the form_Open event. This would have to be done in the routine that calls the form, so it is better to simply test before hand.
Private Sub Form_Open(Cancel As Integer)
Cancel = (Me.RecordsetClone.RecordC
End Sub
However, if you use this technique, you will need to handle the error that occurs when you cancel the form_Open event. This would have to be done in the routine that calls the form, so it is better to simply test before hand.
ASKER
Derek