Odd Events

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

I'm using access 2003. I'm making, what I would consider, major
changes to my database application. I've completed the changes
to 2 forms but now I'm getting odd error messages from the
3rd form. I copied and pasted most of the code which, isn't very much
from the 2nd form to the 3rd form and changed the names of the
fields to reflect the different table.. (Each form does basically the
same things but with different tables.) The 1st and 2nd forms work
fine but the 3rd form, I don't even know where to start!? I was
getting error 3020 "Update or CancelUpdate without AddNew..."
I thought I had a corrupt form so I deleted it - I hate doing that.
I then imported the form from a backup without any of the major
changes I did to the original. Now, this form Is calling a function
that was being called by the form I deleted. Nowhere in the imported
form is this function being called!!!
I'm at the end of my rope. Maybe I ought to start viewing and
editing my data using a datasheet.

Any help will be appreciated.
 
James, it does sounds like a corruption.

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

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. 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"

4. Open Access, and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, and reference ambiguities are
resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
 
It was a corrupt form and it seems to happen whenever I make major changes
to
my db app. It also seems like it's the same form. The code ran fine on all
forms
but when I clicked on a list box on the corrupted form the error occurs and
access closes.
Well, next time I'll be ready for it.
This time I printed your response and will keep it handy.

Thanks,
James
 
Great: the key issues are:
a) Get rid of Name AutoCorrect.

b) Compact after deleting the bad form, before importing it again from an
old copy.

c) Decompile can help with the kind of corruption you described.

If this form has a subform, there is another reason it can go corrupt in
A2002/2003, but that doens't sound like your issue. That one is explained in
the Preventing corruption article (linked from the one below.)

All the best.
 
Back
Top