Break Point without setting one

R

Richard

I'm using the below code. Access is stopping on -If CmdLn = "" Then- as if
there is a break point, but there is none. Pressing F5 the code continues
normally. How do I avoid the stopping?

Private Sub Form_Open(Cancel As Integer)
Dim CmdLn As String, cm
Application.SetOption "Confirm Action Queries", False
CmdLn = Command()
If CmdLn = "" Then
Exit Sub
Else
If CmdLn = "WkReport" Then
DoCmd.RunMacro "WkReport"
End If
End If
End Sub
 
J

Jim Burke in Novi

When I've had that happen it was because I had previously had a breakpoint
set. I forgot exactly what causes this, but sometimes when you clear all
breakpoints some can still 'work'. I think the solution is to do one more
clear all breakoints (not sure if that's even necessary), then do a compile
and they should go away.
 
R

Richard

Jim,
Thanks, That seems to have worked... :)

Jim Burke in Novi said:
When I've had that happen it was because I had previously had a breakpoint
set. I forgot exactly what causes this, but sometimes when you clear all
breakpoints some can still 'work'. I think the solution is to do one more
clear all breakoints (not sure if that's even necessary), then do a compile
and they should go away.
 
K

Klatuu

This is usually caused by setting a breakpoint, then saving.
You obviously have the fix.
Just to avoid it going to production, I have made a habit of always clearing
all breakpoints before saving.
 
M

mray29

Another fix that has always worked for me is to re-type the offending line
then compile.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top