error code 2501

D

David

i hv a access application. and some reports in the application cannot be
generated with error code 2501 given on some of PCs on the LAN, while they
are run okay on some other PCs. All these PCs system is the same, windowsxp.

any suggestion?

thanks!
 
G

Graham Mandeno

Hi David

Is it the OpenReport method which is raising the error? If so, what it
means is that the process of opening the report has been cancelled by some
event. The two most likely events are the Open event and the NoData event.

Check your code to see if either of these events has an associated event
procedure which can set Cancel in some circumstance, then you should be able
to figure out how that circumstance has occurred.
 
2

231290272

David said:
i hv a access application. and some reports in the application cannot be
generated with error code 2501 given on some of PCs on the LAN, while they
are run okay on some other PCs. All these PCs system is the same, windowsxp.

any suggestion?

thanks!
 
W

Wayne Morgan

Graham is correct. This error is usually generated by the code that has the
DoCmd.OpenReport call when something in the report cancels it's opening,
such as when there is no data and you've set up the NoData event to do this.
If that is what is happening, just place an error handler in the code that
opens the report to trap the error.
 
D

David

thanks, wayne & graham. however i don't think it's due to nodata, bcoz on
the some other PCs can open it by the DoCmd.OpenReport call, in fact, there
is data to generate the report.
 
G

Graham Mandeno

Hi David

Are all the tables linked correctly on the troublesome PCs?

I suggest you set a breakpoint at DoCmd.OpenReport and step through the code
a line at a time (F8) to try to find where the event is being cancelled.
 
Top