• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

BreakePoints and 'Stop' being ignored

I have been using Access for many years and never encountered the following.

I'll let you know up front that I have decompiled then recompiled the app and compact/Repaired the app and the following is still true.

I am trying to verify that some new code in my app is working as planned.  I set up a unit test with a button on a bogus form.  The test is simple, call the function multiple times to see what value it returns.  I put a temproary breakpoint (by clicking in the column to the left of the statment) after each call to check the returned results.  I have done this many times to unit test a particular piece of logic.
When I press the button on the form I don't get any breakpoints, not do I get any errors.
I add a message box at the beginning of the sub MsgBox "Start" and a message box at the end of the sub, Msgbox "Exit"  (while keeping all of the breakpoints).
When I click the button I see both message boxes, one after the other but the code still does not stop on the breakpoints.

I add a 'Stops statement after each call to the the function and press the button again.  I see the two message boxes but the code does not pause on the 'Stops' or the breakpoints.

Finally just to make sure my logic is working I put a 'Debug.Print wkCat' after each call to the module.  Looking at the immediate window I can see my function is retuning the results that it should.

Once I encoutnered this I tried putting breakpoints in production forms in the app just to see the effect.  The code is not stopping on any breakpoints or stops that I add.

I put the code that I started with and the code that I ended with in the Code Window.

What is the issue?  These are the only breakpoints or 'Stop' in the entire app.
Private Sub btnGetCategory_Click()  "Initial try
dim wkCat as long
wkCat = GetTestCategory (111)
wkCat = GetTestCategory (111111)
wkCat = GetTestCategory (758)
wkCat = GetTestCategory (1533)
End Sub

Private Sub btnGetCategory_Click()  "Final Version"
msgBox "Start"
dim wkCat as long
wkCat = GetTestCategory (111)
debug.Print wkCat
Stop
wkCat = GetTestCategory (111111)
debug.Print wkCat
Stop
wkCat = GetTestCategory (758)
debug.Print wkCat
wkCat = GetTestCategory (1533)
debug.Print wkCat
msgBox "Exit"
End Sub

Open in new window

0
mlcktmguy
Asked:
mlcktmguy
  • 7
  • 5
  • 4
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Can you:

1) Compact & Repair (*** to shrink the size),

2) Zip up the MDB (*** to further shrink the size)

3) Attach the file for upload here (using the 'Attach File function below) ... removing any sensitive data of course.

4**** And please give a clear explanation of exactly how to reproduce the problem or what you are trying to do.

NOTE:  If you have an A2007 ACCDB, please convert to A2003 MDB.
mx
0
 
mlcktmguyAuthor Commented:
I appreciate your response but unfortunately I can't upload it.  The data is sensitive and MDB is on a client laptop computer that is encrypted, with no access to the internet.  If I transfer the MDB to another machine using a USB memory stick it is uninteligible.

On the problem machine dupicating the issue is easy.  Edit a module, add  a breakpoint or 'Stop' statement, execute the module.  The module runs correclty but the breakpoints and 'Stop' are ignored.

I know this is bizarre behavior and I am almost certain that if I were able to move this MDB to another machine I could not duplicate it.  I know it's a shot in the dark posting it here, especially without the MDB  but I thought someone may have run into it.


0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I know this sounds silly .... but has the problem machine been rebooted ?  I've had a couple of oddball things happen from time to time in the vba IDE ... which only rebooting corrected.  Not very ofter, but ....!

Other than that ... if you have actually done Decompile ... similar to the decompile procedure I post ... then I really don't know.

mx
0
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.

 
harfangCommented:
Weird. This happens with report code (can't stop or break) and of course in runtime mode (but then you can't view the module at all).

Can you break into the code at all? Say by pressing Ctrl-Pause when the msgbox is displayed? Does it break if you execute "a = 1/0"? What are your setting under "Tools / Options, [General], Error trapping?

(°v°)
0
 
mlcktmguyAuthor Commented:
Tried your suggestions am amazed at the results, or lack of them

1. "Can you break into the code at all? Say by pressing Ctrl-Pause when the msgbox is displayed? " 
No effect when I press the Ctrl-Pause while the Msgbox is displayed.  Execution continues

2. Does it break if you execute "a = 1/0"?  Amazingly it does not stop.

After #2 I added an 'On Error Goto Here3' right before the divide by zero statement'  Here3 has a messagebox saying "there was an error"  When I executed the code I saw the message "there was an error"

3.  "What are your setting under "Tools / Options, [General], Error trapping?"
"break on unhandled Errors" is selected.  I tried selecting the other two options "Break On All Errors" and "break In class module".  Neither had any effect.

0
 
mlcktmguyAuthor Commented:
as a followup to #2, I put an 'On Error Goto 0' just prior to the divide by zero statement.  The code continued to run, without breaking or notifying me of an error.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Evil Forces From Outer Space !!

mx
0
 
mlcktmguyAuthor Commented:
Defiitely not Santa Clause, unless he figures I was naughty this year and this is my 'lump of coal'.

I know this is bizarre.  I have been using Access for over 10 years and never run into this situation.  This is a client supplied laptop and I'm fairly certain that the issue is being caused by something specific to this laptop but I have no idea what.

One of the other analysts at this client was having an issue with not being able to edit existing reports in an Access MDB.  After much fooling around they resolved the issue by changing his default printer.  Unbeliveable, but true.
0
 
harfangCommented:
The story about printers rings a bell. Microsoft Access has always been way too dependant on the default printer. You can't even create a report if no default printer has been selected...

But the "no break to VB" condition it new to me as well. Sorry I don't have the answer... It behaves like in run-time mode, except that the code is visible.

You can try other Office products. Try a divide by zero error in Excel or Word. This would at least tell us if it's a global VB setting or something specific to Access.

(°v°)
0
 
harfangCommented:
If it works in other Office products, try it in a new database as well.

(°v°)
0
 
mlcktmguyAuthor Commented:
I created a completely new blank database on the client machine.  I added a simple table and used the form generator to create a simple form based on the table.

Short answer: Everything works like it should.

I put a break point on the 'Private Sub Form_Load()', the logic stopped and the line was highlighted in yellow.

I put a 'Stop' statement and the logic stopped.

I added the a = 1/0 zero statement and got a divide by zero execption.

So it appears that it is not just machine specific but my MDB running on that machine.  I have lot's of code in modules.  Are there any thresholds on memory for storing variable names, subroutine names etc..
I really wish I oculd upload the MDB but it is not possible.

0
 
harfangCommented:
This will sound silly.

Import stuff from the "stubborn" database into the new one. If needed, import objects one by one. Either the problem will not transfer, or it will when you import a given object. Then we can examine that object more closely.

Sorry I have no better advice.

(°v°)
0
 
mlcktmguyAuthor Commented:
I was thinking the same thing.  I won't be able to do it tonight.  I'll try tomorrow.  Thanks for your interest in my problem.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You did try rebooting that machine, right ?

mx
0
 
mlcktmguyAuthor Commented:
Yep, several days ago and I've completely shut it down each night with no change.

This morning I created a new MDB and imported everything from the old MDB into it en masse.  The problem has dissapeared in the new MDB so moving forward I'll use that one.
0
 
harfangCommented:
I'm glad it worked, and sorry I don't have an explanation for it. I can tell you this is a rare problem, I don't expect you to meet it again soon.

Success with your project!
(°v°)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now