Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Dim msg
If Unsaved And TestPoint > 2 = True Then
msg = "The Current Data Has Not Been Saved. Do You Want to Exit?"
Else
msg = "Do you Wish to Close the Application?"
End If
If MsgBox(msg, MsgBoxStyle.YesNo + MsgBoxStyle.Question, "DCP Data") = MsgBoxResult.No Then e.Cancel = True
End Sub