?
Solved

Problem with Stop and Breakpoints

Posted on 2011-10-31
6
Medium Priority
?
271 Views
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
   Stop
   MsgBox "Test Message 2"
     
End Sub

Open in new window

0
Comment
Question by:CRB1609
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 37055722
Make sure you have 'Use ACcess Special Keys' selected in the Access options for the Current Database.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 37055748
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.
0
 
LVL 75
ID: 37058864
"2) Compact the code"
I suspect you meant do a Compact and Repair on the db ...

mx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Closing Comment

by:CRB1609
ID: 37059631
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.

CRB
0
 
LVL 75
ID: 37059986
You mean the Reference issue ....?

mx
0
 

Author Comment

by:CRB1609
ID: 37060191
mx,

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

crb
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

839 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