
Signature
Wishing you a VERY HAPPY NEW YEAR!!
May it far exceed your expectations.
>I found how to do this for forms using RecordsetClone.RecordCount = 0
>and using Cancel = True.
>
>How can I do the same thing for a form?
For a report, use the NoData event:
Cancel = True
The report will not display, but you will get an action was
cancelled message. If you opened the report from VBA code
in a form's event procedure, you can trap error 2501 and
ignore the error. If you need help with this, post the form
procedure that opens the report.

Signature
Marsh
MVP [MS Access]
Carl Mankat - 28 Oct 2005 19:04 GMT
Thanks, I tried that and it gave me what I was after. Will Access Help
give me anything about Cancel?
TIA, again,
Carl
>
>
[quoted text clipped - 15 lines]
>
>

Signature
Wishing you a VERY HAPPY NEW YEAR!!
May it far exceed your expectations.
Marshall Barton - 28 Oct 2005 19:43 GMT
Cancel is mentioned in the NoData Event topic in A03, but it
doesn't say any more than setting it to True prevents the
report from printing.
If that's all you do, pretty soon you will notice the pop up
message. Most people don't want to see this so I Suggested
the way to suppress the message.

Signature
Marsh
MVP [MS Access]
>Thanks, I tried that and it gave me what I was after. Will Access Help
>give me anything about Cancel?
[quoted text clipped - 13 lines]
>>ignore the error. If you need help with this, post the form
>>procedure that opens the report.