OnNoData for my form

B

Bonnie

Hi there. Using A02 on XP. Love the OnNoData Event for
reports. But, I have a form that I would like to show a
message when there are no records and cancel the form open
event. Otherwise, go ahead and open. How is it best to do
this? Thanks in advance for any help or advice.
 
F

fredg

Hi there. Using A02 on XP. Love the OnNoData Event for
reports. But, I have a form that I would like to show a
message when there are no records and cancel the form open
event. Otherwise, go ahead and open. How is it best to do
this? Thanks in advance for any help or advice.

In the form's Open event:

If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No Records"
Cancel = True
End If
 
B

Bonnie

Excellent! Thanks SSOOOOOOO much!
-----Original Message-----


In the form's Open event:

If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "No Records"
Cancel = True
End If

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 

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

Similar Threads

Need OnNoData for Forms 7
Dumb question alert! What program to use? 0
Need to skip open OnNoData 1
OnNoData event 2
No Records for Form 6
Record Count zero on form 3
Cancel = True - error 2
Error 2501 7

Top