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

Getting error msg "Can't enter break mode . . ."

Status
Not open for further replies.

hazlehurstga

Programmer
Sep 4, 2003
19
0
0
US
I'm receiving the following error the first time I attempt to add a line to a procedure control module :
"Can't enter break mode at this time."
The error dialog box asks if I want to continue or end the program. When I choose to continue, the program runs until completion but the debugger is no longer available for breaks or error trapping. The code where this problem occurs looks like this:

Set mdl = CurForm.Module
' Add event procedure.
The error message appears when I attempt to execute the next line:
lngReturn = mdl.CreateEventProc("Click", ctlModule.Name) + 1

Does anyone know why this is happening and what I need to do to stop it? Thanks


 
Hi hazle,

I believe that this Method can only be used on forms that are in design view. It appears that you are trying to use it on the current form that is in form view, which is why it is telling you it wants to break code.

Regards,
gkprogrammer
 
Actually I opened the form in design view using the following statements:

DoCmd.OpenForm NewFname, acDesign
Set CurForm = Forms(NewFname)
CurForm.Visible = True

Should the form be invisible when I add the procedure statement?
 
No the form doesn't have to be invisible, you would probably just want to open the form minimized in design view and run the code from an external form/module. If you do this it should work properly, if you are still having problems you should post your code for this in it's entirety, this may help to point out where the problem is.

Regards,
gkprogrammer
 
Hi hazlehurstga,

I think you have to find some other way to debug this type of code. Basically you are messing with the debugger's environment and, as it says, it is unable to enter break mode. Your code will run (assuming it to be correct) but you have to test like it used to be - desk checks, displays, etc.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top