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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code doesn't execute right, won't break at Stop

Status
Not open for further replies.

smandoli9

Programmer
Jun 10, 2002
103
US
Code:
  Private Sub btnMyButton_Click()
      Stop
      If MsgBox("Please, please", vbOKCancel) = vbOK Then
          Stop
      End If
      Call ProcedureOfMine
  End Sub

When I invoke this from the form, the MsgBox appears but the vbOK path does not cause the code to stop.

Stop will not stop the code in either place, and ProcedureofMine does not get called. Stop inserted elsewhere in modules also does not cause code to break.

Breakpoints in the code also do not break the running!

I decompiled, compacted and recompiled. Have I got some extra-evil corruption?

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
This code worked for me:

Code:
Sub test()
   Stop
      If MsgBox("Please, please", vbOKCancel) = vbOK Then
          Stop
      End If
      Debug.Print "hello"
End Sub

May I suggest this:
* From a module use the menu commands Tools > Options. Click on the General Tab.
* Select "Break on all errors."

Good luck.

Alan
 
Thanks Alan. 'Break on all errors' was already set.

Finally concluded it was one of those weirder corruptions. I made a fresh .mdb and imported all objects. This has seems to have solved the problem.

Post of inscrutable value?
If so, Red Flag it!

[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top