how to stop an infinite loop?

G

Gijs van Swaaij

Just a quick question: how can I kill an infinite loop without losing
my unsaved data? I'm asking because I just lost half an hour of work
after ending access with Task Manager, after it had entered an infinite
loop. For the second time... Ctrl-C doesn't work, neither does anything
else I tried. Does anyone know how I can end it?

Thanks,
Gijs van Swaaij
 
W

Wayne Morgan

Try Ctrl+Break. On most keyboards the Break key is near the Print Screen and
Scroll Lock keys.
 
A

Al Camp

Gijs,
If you have some code that's causing this, try forcing a Save/Update of the Form/Data
before the code runs. Just until you get the code corrected...
Ctrl-C doesn't work, neither does anything
else I tried...
Please indicate what those are... so folks don't suggest solutions you've already
tried.

I've had some success with Ctrl-Break on inadvertent endless Loops.
 
J

John Vinson

Just a quick question: how can I kill an infinite loop without losing
my unsaved data? I'm asking because I just lost half an hour of work
after ending access with Task Manager, after it had entered an infinite
loop. For the second time... Ctrl-C doesn't work, neither does anything
else I tried. Does anyone know how I can end it?

Thanks,
Gijs van Swaaij

Ctrl-Break (often repeatedly).

John W. Vinson[MVP]
 
L

Larry Linson

Gijs van Swaaij said:
Just a quick question: how can I kill an infinite loop without losing
my unsaved data? I'm asking because I just lost half an hour of work
after ending access with Task Manager, after it had entered an infinite
loop. For the second time... Ctrl-C doesn't work, neither does anything
else I tried. Does anyone know how I can end it?

Ctrl-Break always works if you happen to have a DoEvents in the loop.
Otherwise, you may have to click it over and over and over and just hope
something causes a break in the executing code so it can be sensed and
responded-to.

The fortunate thing is, if you code in a structured manner, VBA makes it
more difficult to create endless loops than it was, back in the "olden days"
in Assembler Language.

Larry Linson
Microsoft Access MVP

Larry Linson
Microsoft Access MVP
 
A

Al Camp

Hi Larry,
Looks like your "signature" on your last post got started on a loop... :-D
Al Camp
 
G

Gijs van Swaaij

Thanks for all the advice! I just recreated an infinite loop, and
ctrl-break works.

Gijs van Swaaij


Al Camp schreef:
 

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