How to remove code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been having alot of grief with my database these couple of days. Every
time I click on a particular form, I keep getting an error that says Invalid
procedure or argument and it seems to stop at certain portions of the code at
random. When I make any changes to the form and try to save them, the
following error will popup successfully for about 8 times:

First dialog box:
The changes you requestd to the table were not succesful because they would
create duplicate values in the index, primary key, or relationship. Change
the data in the field or fields that contain duplicate data, remove the
index, or redefine the index to permit duplicate entries and try again.

Second dialog box:
Record is deleted.

When I try to quit the Access totally, I get the errors:
The save operation failed.

Then
Access could not save the project. Do you want to cancel the close operation?

I managed to delete the report that seemed to be the problem but now it
seems the code behind the report is left in the project and I could not
delete it. How do I get rid of it? Thanks.
ck
 
Sounds like your mdb is corrupted. If a compact and repair will not fix it,
then the best bet is to create a new empty mbb and copy all the objects from
the old db. If that does not resolve the problem, the do the same thing
again, except, here it gets harder:

Copy all your code from modules, forms, and reports to a text format (Note
Pad will do).
Go to each report and form and and change the Has Module property to No.
Then copy all your objects to the new mdb, and cut and paste your code back
into the objects your removed them from.
 
Thanks. Boy, am I glad to hear there still seems to be some hope of
recovering the db...
ck
 
I'd highly suggest making a backup too (if not already) in the case that the
compact/repair destroys your database like it has many of mine
 
By the way, do you know if there is any way I can import customized menu and
tool bars? Or do I have to recreate them in the new database? Thanks again.
ck
 
On the import panel, click the "Options >>" button --- you'll then see a
checkbox for that... Bob.
 
Back
Top