empty form opens-BAD

B

Beth

What is the method to prevent the opening of a form when
no record exists in that recordset?

Please note: I call the form to open with a command
button that is on an UNBOUND form.

Using HasData does not work as I have used it. It works
well for me when the calling form has a recordset, thus a
field to test that I can point to, but the calling form
is UNBOUND. What to do?

Is there a modification to be made to HasData? Another
method?

Any help is appreciated. This is frustrating.

Beth
 
J

Jeremiah Ellison

Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount < 1 Then Cancel = True
End Sub

What is the method to prevent the opening of a form when
no record exists in that recordset?

Please note: I call the form to open with a command
button that is on an UNBOUND form.

Using HasData does not work as I have used it. It works
well for me when the calling form has a recordset, thus a
field to test that I can point to, but the calling form
is UNBOUND. What to do?

Is there a modification to be made to HasData? Another
method?

Any help is appreciated. This is frustrating.

Beth

Jeremiah Ellison
Ellison Enterprises - Your One Stop IT Experts
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top