I just want to make these statements so that when the if is true, the message box is shown and the form is not closed. If the required fields are blank, then the form should not close, but it is closing after you click the message box. Can anybody help me with this?
Quote:
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
If Me.edit_type.Text = "" Or Me.editname.Text = "" Then
'MessageBox.Show("Please fill the required fields.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
'Update the Dataset
Me.UpdateDataSet()
End If
End Sub
|