1

Is there a way I can make the application MS Access and VBA more verbose in order to better diagnose errors from the IDE?

I open my MS Access project, I get a message dialog box, titled "Microsoft Visual Basic for Applications" with the message "File not found:" without any path specified. Opening the form file works as expected.

When I go into VBA, I can run some commands from the Immediate window. The following actions will make MS Access crash, showing a messaged box titled "Microsoft Access has stopped working":

  • Closing the database
  • Stopping the debugger (it opens being active, trying to load a form)
  • Selecting text of the procedure I was working on when MS-Access / VBA initially crashed.
Julien Lamarche
  • 931
  • 1
  • 12
  • 29

3 Answers3

0

This does not answer the question, but it seems the underlying problem has been fixed by deleting the procedure in question, letting MS Access crash and re-opening VBA.

Julien Lamarche
  • 931
  • 1
  • 12
  • 29
0

To answer the question in your title: If the error is actually cause by VBA code, you can catch the error (using On Error Goto ...) and provide additional information based on the context of your method (the file you were trying to open, etc.). Unfortunately, there is no magical switch to make the built-in error messages more useful.

To answer the question in your question body: From what you describe, the error is not caused by actual user-supplied VBA code. Instead, your database or its VBA module is corrupt (Access crashing or showing seemingly random errors is a strong sign of that). Repair, compact and decompile your database. It might be worth checking out the VBA references as well, so see if any of those are missing.

Community
  • 1
  • 1
Heinzi
  • 167,459
  • 57
  • 363
  • 519
0

can you execute the command resume in the immediate window ? it should send you back to the code line where the file was not found.

libert
  • 59
  • 1
  • 5