VB Code:
Public bExit As Boolean 'Form1 sets this to true when they want to quit!
Public bError As Boolean 'Form1 sets this to true when there's an error!
Public Sub Main()
Form1.Show
Do
DoEvents
Loop Until bExit = True Or bError = True
If bExit Then
End
Else
Msgbox "There has been an error......"
...
End If
End Sub
Or maybe just having error handling in the form_main event would do; Seeing as not specifying LOCAL in the On Error statement makes it react to Subroutine calls erroring out, it (MIGHT) do the same. I don't think so though!... :(