Report fails to save

C

CivilTech

Hello All:

From VBA, I change several properties of an Access 2003 report. After
completing all of the changes, the DoCmd.Close method attempts to closed a
hidden report opened in design view. Without generating an error message, the
report fails to save.

Calling DoCmd.Save after each property modification results in a run-time
error message of 2501: "The save action was canceled"

Can anyone provide a solution or workaround?

The database is in MS Access 2003 SP3 running on MS Windows XP Professional
SP3.

Thanks for the assistance!
 
K

Klatuu

There has to be something in the changes you are making that in incorrect.
The 2501 error can be misleading. It will cancel an operation because of
another error.
For example it could be a syntax error or a reference error that would not
show up until you try to save the report.

I would suggest you breakpoint your code after you have made the changes,
and make the report visilbe, then try to save it manually. It will probably
point out the error at that point. Be sure you check the report's record
source in the process.
 
P

Paolo

Hi CivilTech,

be sure that the db is opened in exclusive mode or at least that no other
users are connected.

HTH Paolo
 
C

CivilTech

Everyone:

Thank you for your help!

After much modification, I suspect the problem resulted from an ADO
recordset Find method call.

For some reason, the compiler/interpreter did not like programming as
written but failed to flag the error until implementation of other minor
modifications occurred. Eventually, the compiler/interpreter flagged an
improper calling reference error.

Part of the problem lies in the fact that I am a C programmer by training. I
have no training on VBA, ADO, or DAO. As it has been said, "Necessity is the
mother of invention". This work assignment is a perfect example and its not
the first instance of earn while you learn!

Thanks once again,
CivilTech
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top