G
Guest
I need to test for "No Data" before a form a is display.
Is "HasData" a solution. If so, How do I setup the code and on what form
event.
Is "HasData" a solution. If so, How do I setup the code and on what form
event.
I need to test for "No Data" before a form a is display.
Is "HasData" a solution. If so, How do I setup the code and on what form
event.
Jeff Conrad said:in message:
Use the form's open event to test the recordset returned.
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "There are no records to display at this time." _
, vbInformation, "No Records"
Cancel = True
End If
End Sub
You will of course need to trap for and ignore Error 2501
in the code routine that opens the form.
Thank you Jeff
Solution worked perfectly