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

Breakpoint does not work.

Status
Not open for further replies.

MrMajik

IS-IT--Management
Apr 2, 2002
267
Using MS Office XP Pro running on Windows 2000.

I can't use breakpoints in the VB editor with a database. The red breakpoint bar appears but code execution does not stop.

I can use the breakpoint on a different database just fine.

Any ideas about this? I looked at the Options choices and did not see anything there that will turn breakpoints on and off.
 
Add a breakpoint somewhere else, and see if the code stops, maybe the code you are trying to break on isn't running.
 
dynamictiger;

Not sure what you mean by using a Stop. I put a

Do While i = 100

and omitted the Loop statement hoping the error would take me into the editor. When I ran the code from the form I received a run-time error in the form, not the editor.

The tested to make sure the code was running by changing its behavior a little and the change shows up on the form.

I may have compiled the code by mistake. Would this prevent the breakpoint from working?

I also rebooted my PC and it did not make a difference.
 
Stop command stops execution and should display the code in the editor. I use it because my code is either executed by Open or I've called it from a VB executable...thus no open VB editor in which to set a breakpoint. Once in the debugger, I set all the breakpoints I want.

From the Help in the Word VBA Editor.
"Stop Statement
Suspends execution.
Syntax
Stop
Remarks
You can place Stop statements anywhere in procedures to suspend execution. Using the Stop statement is similar to setting a breakpoint in the code.
The Stop statement suspends execution, but unlike End, it doesn't close any files or clear variables, unless it is in a compiled executable (.exe) file." Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Omitting the Loop statement didn't give you a runtime error, actually. What happened is that you didn't compile the code before opening the form, so VBA tried to compile it at first reference. The "Do without Loop" error is a compile-time error.

Your description of the problem made me think of something that happens to me occasionally. Usually, you can hook an event procedure to a form either by setting the form's event property and hitting the "..." builder button, or by creating the procedure in the code window and letting Access automatically set the event property for you. But sometimes, for reasons I haven't figured out, you can create the procedure but the event property doesn't get sent. In such cases, the event procedure never actually gets called, so of course a breakpoint in it is never activated. Could this be your problem? (Check the form's event property.) Rick Sprague
 
HI
CAN ANY ONE HELP ME REGARDING THIS
--HOW TO MAKE MICROSOFT ACCESS EXE FILE LIKE VB EXE FILE.AND HOW TO INCLUDE MICROSOFT DIALOGUE COMPONENT IN
 
I have had the same problem... have you established what the problem was?

It appears to be when Im working on Access 2000 databases under access XP... no problems working on XP databases in XP.
 
Check to make sure the Use Special Key selection is checked in the startup options in Access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top