For lnAttempt = 1 to 10 Try llDone = .F. * Block start ? m.lnAttempt If m.lnAttempt < Rand()*10 Error 1 EndIf * Block end llDone = .T. Catch EndTry If m.llDone Exit EndIf EndForHowever, if there's a problem it might be better to find out what is causing the problem and why you get an error, at all.