Module breaks with no breakpoint added

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmagoo22
    New Member
    • Jan 2008
    • 5

    Module breaks with no breakpoint added

    My issue is this. I have a function that checks to see if a field isNull. If it is it prompts a msgbox and lets the user no to enter a valid number. What happens is the user enters the number and they are directed to this line of code in the VBA Module? I have no breakpoint selected anywhere near this line of code. Actually, no breakpoints exist in this entire application. How or why is this stopping at that point? Has anyone else ran into this?

    Thanks,
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    If we are talking about the same thing then yes I have.

    Symptom
    The code stops at a line as though there was a breakpoint set even though there isn't one. There is no error message so it didn't stop because of an error and if i click the run button to continue, the program continues on and all is well.

    Solution
    Can't remember the exact process I took but it was something like this

    In code mode I actually set the break point at the line it kept stopping at.
    Then a ran the program and it stopped at the breakpoint.
    Then I clicked the run button to continue.
    After the program finished I went back to code mode and turned the brekpoint back off and saved .

    After that the program ran without stopping. ????????


    I know that at some stage prior to the problem appearing I had been setting and unsetting brekpoints trying to find some bugs in my code. I guess that somewhere along the line I performed a sequence of events that found a bug in vba itself, where vba finds a breakpoint at run time and stops there, but dosn't find the breakpoint at design time and therefore dosn't display it.

    Hope this resolves your problem

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32637

      #3
      I've had this too. My solution was similar.
      1. Open spreadsheet and Alt-F11 to VBA window.
      2. Make a simple change (Delete then re-applying a single character will do - but you must move the cursor off the line in-between).
      3. Close all open code windows.
      4. Compile project.
      5. Alt-F11 back to spreadsheet.
      6. Close & save.

      Comment

      • fhuang3
        New Member
        • Feb 2008
        • 1

        #4
        I have similar problem. My solution is as follows:

        1. Comment out the line that causes the stop
        2. Run the procedure once with the affending line commented out
        3. Exit Access
        4. Restart Access
        5. Uncomment the affending line.
        6. Run it once
        7. Recompile by clicking on debug-> compile

        It works charmingly.

        Best, James

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32637

          #5
          Ah, good for you!
          You seem to have come across the famous "perfect code - but Access got its knickers in a twist" bug :D
          Often seen in declaration type code (Constants etc).
          You've found the solution already it seems. well done.

          Comment

          • Chris Thompson
            New Member
            • Nov 2010
            • 1

            #6
            Unmarked Breakpoint

            When I observed this, I had just set a few breakpoints and had closed Access. I believe it had crashed on closing.

            To fix it, I too commented out the offending line, got off the line, and then went back to it and took the comment mark off.

            I then compiled/saved/exited and restarted. Cleared right up.

            Comment

            • miguelito
              New Member
              • Aug 2014
              • 1

              #7
              Four years later and it is still a nightmare! And what a waste of time: All morning trying to understand why, but fortunately, the solution is still the same! :)
              Thanks for this post!
              ps: vba Excel

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32637

                #8
                Just goes to show - old threads ain't dead while they can still help people out there :-)

                Comment

                Working...