NeutralPoint
Programmer
Hi all,
In Access 97, I need to cancel a report printing if a calculated control (edit text one) fails to be calculated. How to do-it ?
My current state:
-----------------
A report called from a form through a "DoCmd.OpenReport strReportName, acNormal, , strLinkCriteria".
In the report, a control called "AddressCtrl" with its SourceControl as "=DefAddress()" and a DefAddress() function which set a global flag like "bAbortReport=True" if the address calculation fails to be completed.
From this point, where to use the bAbortReport flag ?
I've tried to place a "If bAbortReport=True THEN Cancel=True" in the OnFormat and OnPrint events of the concerned section (the calculated field is in a GroupHeader section) but the events happens before the field calculation (ie. internal call to DefAddress()). I've tried using the OnPage event of the report, but there's no Cancel parameter to manage, prior to effective printing.
Well, do you have an idea ? What's the point I've missed ?
Cordially
Eric
In Access 97, I need to cancel a report printing if a calculated control (edit text one) fails to be calculated. How to do-it ?
My current state:
-----------------
A report called from a form through a "DoCmd.OpenReport strReportName, acNormal, , strLinkCriteria".
In the report, a control called "AddressCtrl" with its SourceControl as "=DefAddress()" and a DefAddress() function which set a global flag like "bAbortReport=True" if the address calculation fails to be completed.
From this point, where to use the bAbortReport flag ?
I've tried to place a "If bAbortReport=True THEN Cancel=True" in the OnFormat and OnPrint events of the concerned section (the calculated field is in a GroupHeader section) but the events happens before the field calculation (ie. internal call to DefAddress()). I've tried using the OnPage event of the report, but there's no Cancel parameter to manage, prior to effective printing.
Well, do you have an idea ? What's the point I've missed ?
Cordially
Eric