K
Kari
Every time I try to use the "On No Data" even to cancel opening a report it
crashes Access. That is, if I insert the following code in the On No Data
event:
MsgBox ("No data for report)
Cancel = true
When I try to open the report in a circumstance where I know there is no
data, Access itself crashes ("Access has encountered a problem and needs to
close").
At first I thought it might be a bug in Access 2007 bug, but I haven't seen
any posts about similar problems. I created a new report (based on the same
query) and put the cancel code in the On No Data event. It works just fine,
cancels the report if there is no data. From this I conclude that there is
some code in my actual report that is somehow clashing with the Cancel and
causing the crash.
Do anyone have any advice on how to fix this? I'm stumped.
Thank you for your help (and all your help in the past!)
Kari
crashes Access. That is, if I insert the following code in the On No Data
event:
MsgBox ("No data for report)
Cancel = true
When I try to open the report in a circumstance where I know there is no
data, Access itself crashes ("Access has encountered a problem and needs to
close").
At first I thought it might be a bug in Access 2007 bug, but I haven't seen
any posts about similar problems. I created a new report (based on the same
query) and put the cancel code in the On No Data event. It works just fine,
cancels the report if there is no data. From this I conclude that there is
some code in my actual report that is somehow clashing with the Cancel and
causing the crash.
Do anyone have any advice on how to fix this? I'm stumped.
Thank you for your help (and all your help in the past!)
Kari