Non-descriptive error message

D

Dave

I am using Access 2000 on a XP Pro machine at work. I created a report this
morning and had another open to copy some elements from and paste in the new
one. General stuff: company logo and such. Was testing it out and started
receiving the first of 2 messages.

1. "You cancel the previous operation" which may be the root cuase of all
this. I did want to save the new form, but not the one I copied from. After
all, I didn't make any intentional changes to the existing form.

2. Later on I started receiving the following error message "Module not
found" which is bogus since it is there and can get to it from the form's
property sheet.

So I am totally confused and lost on this one. Probably didn't explain
everything you need to know, but that is the situation. Thanx for the help.
 
A

Allen Browne

Hi Dave. This sounds like something went wrong in the copying process, or
possibly that the copying disclosed a corruption that was previously
present.

1. You say you can see the module that Access can't find? Copy all the text
from the module, paste into Notepad, and save it as a text file for later.
(I assume this is the module of the report you were copying.)

2. Cose Access, and make a backup copy of the database so you get multiple
attempts at recovering this.

3. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

4. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair

5. Close Access. Decompile the database by entering something like this at
the command prompt while Access is not running. It is all one line, and
include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

6 Open Access (holding down the Shift key if you have any startup code).
Open the report in design view, set its HasModule propety to No. Save. Close
the report.

7. Compact again.

If the problem still exists, I would be interested to know if this
particular report name shows up in this query:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

If it doesn't you have struck a reasonably rare corruption where the 2
different lists of objects stored in Access 2000 and later don't match, i.e.
the list shown in this hidden system table, and the list exposed by
CurrentProject.AllForms. The solution will now be to create a new (blank)
database, turn off Name AutoCorrect, and import all the *other* objects.
Steps outlined in the first symptom in this article:
Recovering from corruption
at:
http://allenbrowne.com/ser-47.html
 
D

Dave

Hi Allen

I had done some of what you instructed. Copy code and HadModule=No; but
didn't know enough to switch off settings in Tools\Options. So will work on
that. Appreciate the advise. Will let you know my progress.

Dave
 
A

Allen Browne

Just to clarify, the idea is to go to the Tools menu in the main Access
window, and choose Options (the last item.) Access opens a dialog, and on
the General tab you will see the text boxes for the Name AutoCorrect
options.
 
D

Dave

Hi Allen
Followed your instructions to unjumble this db. When running decompile, the
db opens and says "You previously canceled this operation." It presents that
message 4x. I deleted the report I was working on with the same results.
The deleted report did not appear when running the suggested query. Curious
to know more about that particular query statement.

Started moving everything to new db. I cut the code from the form before
copying it to the new db. Then would install code after that. One form gave
me an error stating On Load exists already from a previous copy. I had a
couple images on that form. Redesigned that form from a different approach
now.

Seems some of these errors just don't give enough information to debug. Use
the compile function in VB to find any more errors. You comments are very
valuable and appreciate the help.
Dave
 
A

Allen Browne

Okay, some more background on that query.

Access has always used hidden system tables to manage the stuff in your
database. From version 1, the MSysObjects statement has been the definitive
list of the objects in Access, each defined by its own Type. It's fairly
easy to figure out, but these are the meanings of the various types:
- Tables: 1
- Queries: 5
- Forms: -32768
- Reports: -32764
- Modules: -32761
- Linked tables: 6
- ODBC linked tabes: 4
Actually, you were supposed to get at those objects through the Documents in
the various Containers of the database, using DAO code rather than querying
the system table directly.

In Access 2000, Microsoft removed the code editor in Access, and cobbled it
together with a separate VBA editor. As part of that process, they decided
to create another collection of objects such as the AllForms collection of
the CurrentProject. As anyone who writes databases knows, having 2
definitive sources is asking for trouble: you've opened the door to problems
when the two are not in sync. And sure enough, there are cases where Access
gets confused, so the AllForms or AllReports collection does not match the
MSysObjects listing, and so the database is corrupt.

From experience with this kind of corruption, we know that the Database
window in Access 2000 and later displays the names in the Allxxx
collections, not the MSysObjects list. Hence the suggestion to try the query
was aimed a uncovering whether this is the kind of corruption you
experienced.

Decompile solves a different kind of corruption.

The Name AutoCorrect options cause bad crossreferencing between objects,
which results in another raft of issues.

The general approach is to identify the problems you have, decompile, create
the new database, kill Name AutoCorrupt in the new db, import the objects
known to be good, backup, and see how far you can get in importing or
recreating the bad ones.

The undocumened SaveAsText/LoadFromText sometimes helps too.
 
D

Dave

Hi Allen

I imported the few reports I know are good into a new db. One form gave me
troubles saying it had an error with On Load command which the VB code
doesn't contain any. Since I was going to redesign that anyway, I ditch it
in favor of my new design.

Should the Track Name be turned back on at some point or left off? The
information you gave me will help track down any further issues now that I
understand the construction of information in Access better thanx to you.

Have not worked in Access for some years and now things are coming back with
your help. Thank you.

Dave
 
A

Allen Browne

Name AutoCorrupt stays off permanently in any database I have anything to do
with. It is the first thing I look for in any database that is going wrong.
There's a couple of dozen bugs we listed here:
http://allenbrowne.com/bug-03.html
and I don't even try to keep that page up to date with all our experiences
of flaws in this mis-feature.

When A2003 was released, we did try turning it on on a *copy* of a database
where we knew there were forms referring to queries where the tables had
been deleted, in the hope of using the Dependency info to identify these
problems. Access crashed (shut down by Windows), repeatedly, and we never
did get that code to run to completion.

There is no scenario that would even begin to tempt me to enable this
nightmare.
 
D

Dave

Thanx Allen.
Off it will stay from now. More use to creating applications in VB and
creating templates for users in MS Excel. Figured Access has too hidden
quirks in it and not enough time to chase them when an application is needed
pronto. But forced into a db here since it is for a client I am working for.
Trying to resurrect my db class knowledge on the fly. Appreciate you
sharing your knowledge.

Dave
 

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