0

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?

3
  • 2
    Sounds like a damaged database (the frontend database). I'd try 1. repairing/compacting it and, if that doesn't help, 2. decompiling it. Commented Apr 17, 2013 at 12:30
  • and if that doesn't work importing the objects into a new blank database. Commented Apr 17, 2013 at 13:04
  • Sorry - put comment as separate answer. Commented Apr 17, 2013 at 13:43

1 Answer 1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.