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

Access 2003, break points not working

Status
Not open for further replies.

Griff389

Technical User
Jun 27, 2003
82
GB
Hi Guys,

i'm looking for some help in my access 2003 vba.

It seems that if I put break points (the red circle at the beginning of the line) in my code in order to debug something, they don't appear to break the code. When I reach where a break point should happen in the access form, I don't get taken back to the code. Instead the code just carries on running past the break point.

I also had an unfinished line of code in my form_current which should have errored when I changed records in the form. But this also didn't through up an exception like i'd have expected to.

Have I inadvertantly switched something off, or have I got a problem somwehre.

Regards

Griff
 
What happens if you add a message box to the code?
 
It works fine.

I just tested by adding a new button to the form, adding these two lines of code:

MsgBox "test", vbOKOnly
MsgBox "test2", vbOKOnly

and putting a break point on each line.

When I clicked the button it just ran both message boxes, despite their being the two break points too.
 
Incidently, this is on Vista, but I'm sure that's not the issue as I get the same results when test it on an XP Virtual machine too.
 
Put Stop st the very start of the sub, before anything else.
 
I still get both message boxes firing instead of breaking.

Code:
     Private Sub Command17_Click()
     Stop

*    MsgBox "test", vbOKOnly
*    MsgBox "test2", vbOKOnly

     End Sub

(The * indicates the breakpoints)
 
In the code window, what is Tools->Options->General->Error Trapping set to? Can you compile? Have you done a compact & repair? Are any of your references marked MISSING? Have you tried a new, test database to see if that works?
 
The error trapping is set to "Break on Unhandled Errors"

Yes compiling seems ok, and i've 'compact and repaired' it a few times.

Not sure on any references missing.

It definately seems to be something in the Database. I tried it with a different database (an old copy of the one i'm working on) and it breaks fine using the above example code.
Guess i'll have a trawl through the code and see if there's anything that jumps out.

I have been working between Access 2003 and Access 2007 but not sure if I actually edited this db in 2007.

Any other ideas are stll welcome of course.
 
You will find references under Tools->References.
 
everything that is referenced is fine.

(cheers for the help by the way :) )
 
Thanks for the link. That didn't work either.
Looks like i'm going to import the forms into my old working copy along with any code I have changed, and see if that works.
 
A fresh, sparkling database is what is usually recommended.
 
I bet that your Alt-F11 combination to open VB Editor doesn't work either. I just fixed my propblem by going to "tools" on the menu bar of Access, then to "startup", then you have to enable "use access special keys" and it should work. Let me know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top