Problem with Stop and Breakpoints

Posted on 2011-10-31
Last Modified: 2012-05-12
When I run the attached Sub with a breakpoint on i = 1, it displays both messages but doesn't stop on the breakpoint or the Stop statement.

Any clues?

Thanks in advance.
Sub Test()

   Dim i As Integer
   MsgBox "Test Message 1"
   i = 1
   MsgBox "Test Message 2"
End Sub

Open in new window

Question by:CRB1609
    LVL 77

    Expert Comment

    Make sure you have 'Use ACcess Special Keys' selected in the Access options for the Current Database.
    LVL 84

    Accepted Solution

    Note too that anytime I see troubles with the VBA section, I always immediately stop and take steps to avoid corruption:

    1) Make a backup
    2) Compact the code
    3) Compile the code - from the VBA Editor click Debug - Compile. Fix any errors and continue doing this until the menuitem is disabled.
    4) Compact again
    5) Decompile the code - build a shortcut with this as the Target: "full path to msaccess.exe" "full path to your database" /decompile
    6) Now do steps 1, 2 and 3 again.

    I'd also build a new, blank database and move everything into that database. This removes any container corruption you may be experiencing.

    Remember to save your work frequently, and make regular backups as you're working.
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    "2) Compact the code"
    I suspect you meant do a Compact and Repair on the db ...


    Author Closing Comment

    Thanks for the procedure.  The problem went away after fixing the other question on 'Problem with Command Bars'.

    As always, your help, mand then others who contributed, was invaluable.

    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    You mean the Reference issue ....?


    Author Comment


    Yes, sorry.  I think I need a brain transplant.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now