1

I have an MS Access form, and on a button click it runs VBA code to run the Shell Command.

 private sub cmdOpen_click()
   dim vValue as String
   vValue = Listbox.column(1) 'Retrieving a path name from a list
   shell "C:\Adobe's Path\Arco.exe " & vValue
 end sub

When I first run this script the first time I open this database, it stops running, opens the script editor, and highlights the shell line. There is no error code, in fact if I just hit the Run button it finishes just fine. If run it a second time there is no issue. Only when I close it down and reopen it. No there is no Breakpoints/stops in the code. Would anyone have any idea why this is happening? I can't seem to fine anyone else with a similar issue.

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
L.P.
  • 83
  • 8

3 Answers3

2

I have had issues with this in Access 2010. I found that there was a breakpoint on that line, and for some reason Access seemed to remember it even after closing the application. For me, it usually happened when I fixed code and someone else ran it.

The only thing I found that seemed to fix it was to set a breakpoint on that line, save the project, then clear it and save it again. Sometimes I had to open and close the project once or twice to get it to completely forget the breakpoint was there.

It seems to me that it's a random, esoteric bug in the Access IDE. It would be fantastic if they would actually make this a feature, but it's not even a bug that can be relied on.

FreeMan
  • 5,660
  • 1
  • 27
  • 53
  • Yep, I am using 2010, and some variation of setting a breakpoint and saving worked. Thanks. – L.P. Mar 31 '15 at 13:51
  • Good thing you accidentally tagged this for Excel, not Access. I'd probably not have seen it otherwise! Fixed that for ya. – FreeMan Mar 31 '15 at 14:04
0

I've had similar experiences with Access and what always helped for me is to copy the text into a Notepad .txt file (or other basic text processing program). Then select it all in the .txt and copy it back.

Mark E.
  • 3
  • 2
0

Decompiling the Access application will solve this too.

Previous SO question: How does one decompile and recompile a database application?

Community
  • 1
  • 1
citizenkong
  • 679
  • 5
  • 14