I've got a single form application.

In the Sub New() of that form I'm creating two database classes.

In those classes if I get database errors (such as connection issues) I'm messagebox'ing the error message and setting an ERRFLAG property.

Back in the Sub New() I'm checking that ERRFLAG and I thought I could ME.CLOSE() - but that's not working.

What all is best practice for this type of operation?

This is what I had up to now

Code:
    Sub New()

        Me.CMCStarting = True

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        vendorBAL_C = New vendorBAL
        If vendorBAL_C.ErrFlag Then
            Me.Close()
            Exit Sub
        End If

        caseBAL_C = New caseBAL
        If caseBAL_C.ErrFlag Then
            Me.Close()
            Exit Sub
        End If

        Call vendorLoad()

        Call caseLoad()

        Me.CMCStarting = False

    End Sub