Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Crash deleted all of the Access VB Code

Status
Not open for further replies.

AnotherGraham

Programmer
Jan 12, 2003
11
0
0
US
The problem arose from a design error that Access 2002 didn't catch. This is how it came about. I needed to create Parent and Child relationships on a Table listing companies. I therefore created a link table with the appropriate Child an Parent columns. This worked perfectly. I then set it up so that a company could see the data in the table of its parent or child.
That also worked perfectly. However I then added a button on the form which allowed the child to edit the data in the parent. This worked so I happily thought that Access was recursive and could handle this sort of thing. However when I saved the changed data the values in the parent had not changed and there was a spurious parent file out in limbo with the changed data.
Access then suddenly sent error messages saying that an external database was attempting to write to it and that the formatting of the current DB was incorrect.It listed two ADOX ?
data sources and was unable to solve what to do. I could find no solution from help. So mistakenly closed the DB.
Afterwards I find the tables and forms and data are all intact but all of the code associated with them has vanished.
I am wondering whether there is a problem with the ADOX catalog ( I know nothing about this) or possibly the Active connection. I would appreciate guidance in this matter which is way over my head.
Thanks Graham
 
Something like ths has happend to me too, but only when I did not save the code before access closes.
For some odd reason access decides to drop entered code and return to old code or, in your case nothing, if access run into en error during the opening of a form or a report.

Access will stop and allow you to debug, but if you do not save the code access will ignore your corrected code and return to the org. code, when the form/report is closed, and this has nothing to do with setwarings.

I think that its bad programming from M$, so remember to save boys!
Rgds
Herman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top