I am trying to cancel a report if there is no data. I put in some VB code for DoCmd.CancelEvent which works when you are running the report manually. However, I am running this through a loop in VB. I basically create a recordset of everyone who gets the report and loop through it. I did not want to print reports which did not have any data because it is printing custom labels. When it tries to open the report in the loop, I get an error
THE OPEN REPORT ACTION WAS CANCELLED. Can I somehow suppress this from popping up for this 1 report or is there another way of getting around this. I was going to do a dlookup and see if there are any records to print but the WHERE condition on this is very intense plus it is just more unnecessary overhead.
Thanks.
Remember when... everything worked and there was a reason for it?
THE OPEN REPORT ACTION WAS CANCELLED. Can I somehow suppress this from popping up for this 1 report or is there another way of getting around this. I was going to do a dlookup and see if there are any records to print but the WHERE condition on this is very intense plus it is just more unnecessary overhead.
Thanks.
Remember when... everything worked and there was a reason for it?