Hi,

This may work:
dim run as boolean

--------------------

do until run = false
' ball bouncing code
loop

Private Sub Form_KeyPress(KeyAscii As Integer)
dim strKey as string
strKey = chr(keyascii)
if strKey = "x" then run = false
End Sub

-------------------

I hope it works!