Max,
Please note that the call to ProgErrorhandler is just a generic routine that
I use to display a message about the error that occurs:
Public Sub ProgErrorHandler(ByVal FuncOrSubName As String, ByVal FormName As
String, ByVal ErrMessage As String, Optional ByVal CloseApplication As
Boolean = False)
'This is the routine that is passed error details for display to the
user and which will shut down the application if the error is sufficiently
'Serious as denoted by the "CloseApplication" parameter, can be left and
False assumed
Dim Msg As String
Msg = "An error has occurred in the " & FuncOrSubName & " procedure in
the " & FormName & " form." & vbCrLf & vbCrLf
Msg += "The error message returned is:" & vbCrLf & vbCrLf & ErrMessage &
vbCrLf & vbCrLf
Select Case CloseApplication
Case False
Msg += "This error is not too serious to continue, but the
information from this dialog should be reported to " & Support
Msg += ". If this error occurred whilst making changes to the
database, it is likely that your data has not been saved. "
Case True
Msg += "This error is too serious to continue running the
application, any outstanding changes will be lost. Please make a note "
Msg += "of the message details above and pass them to " & Support &
" so that the cause of this error can be rectified in a "
Msg += "future release of this application. I apologise for this
problem and will endeavour to fix it as soon as possible "
Msg += "once I know where the error lies."
MsgBox(Msg, MsgBoxStyle.Information, H)
Call EndApplication()
End Select
Dim Resp As Integer = MsgBox(Msg, MsgBoxStyle.Information, H)
End Sub
The variable "Support" just holds the relevant support desk name and number.
The EndApplication routine is just used to close down any global variables
and shut down forms etc
Hope they are useful.
Siv