I have been writing VBA code for a split database, and as of late, some of the command buttons will close the instance of access on the end users machine. No warnings, no ability to stop it from happening. If I add a breakpoint, the code doesnt even hit the click event, it just closes out entirely. This however, is briefly solved by adding a NEW command button and then transferring the code over. What gives?
Asked
Active
Viewed 877 times
0
-
2Sounds like a damaged database (the frontend database). I'd try 1. repairing/compacting it and, if that doesn't help, 2. [decompiling it](http://stackoverflow.com/q/3266542/87698). – Heinzi Apr 17 '13 at 12:30
-
and if that doesn't work importing the objects into a new blank database. – Dan Metheus Apr 17 '13 at 13:04
-
Sorry - put comment as separate answer. – Andy Brown Apr 17 '13 at 13:43
1 Answers
1
Repairing and compacting a database rarely seems to solve database corruption problems, and neither does decompiling it (although these can work).
I'd follow these steps (as per Dan's suggestion):
- create a new database
- import all objects (tables, queries, forms, reports, macros and modules) from old database
At this point it may hang on one particular form or report. If this happens, just omit this form/report from the import (although you may well be unable ever to get at it again!).
Finally, compile any VBA code, repair any references to other VBA object libraries, redraw your relationships window so it looks as pretty as it did before (the relationships themselves aren't lost; just the way they're arranged) - and curse Access!

Andy Brown
- 5,309
- 4
- 34
- 39