Steve,
Sorry, I was just trying to give an overview. If you set the form to keypreview then the form will test for the key first before any control that has focus. Then if you set the form keydown event to test for the escape key and set the variable isCancel = true. Then in your loop add the
doevents
if( isCancel ) then exit sub
dim isCancel as boolean
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'test if key hit is enter
if((KeyCode = 27) 'Esc Key)
isCancel = true
end if
End Sub
Hope this helps, or gets you going in the right direction.