Page 1 of 1

[Solved] Kill report if there is no record

Posted: Sun Dec 29, 2019 9:47 pm
by gkick
Hi ,

Is it possible to stop report generation if the underlying record set is empty? If I recall correctly in some old Access 97 one could pop up a messagebox saying something like There is nothing to print.

Don't open report if there is no record

Posted: Tue Dec 31, 2019 11:30 am
by F3K Total
Hello,
if you open your report by code, first check if the resultset is empty or not, find an example attached, using RowCount of currently displayed rows.
I wont work with parameter-query, better is to use a one-row-filtertable.
For that, i changed query1 and added a structural form, "Filter":
F.PNG
F.PNG (5.89 KiB) Viewed 12861 times
to the formular document.
Enter e.g. "white" into the topleft filterfield, then click "save filtervalue" then click "Filtered Report"
Try it using "dark" also.
R

Re: Kill report if there is no record

Posted: Tue Dec 31, 2019 11:39 pm
by gkick
Thanks for that, will have a look shortly, Happy New Year!

Re: Kill report if there is no record

Posted: Wed Jan 01, 2020 8:00 am
by gkick
Very nice, thanks!