Convert
check_fill_for_New()
into a function that returns a boolean and in bt_Ok_Click check for true or false before message. For example:
Public function check_fill_for_New() as boolean
If tb_UserName.Text = "" Then
MsgBox("Please Insert User Name Field", MsgBoxStyle.OkOnly, "Error")
tb_UserName.Focus()
return false
else
return true
end if
End Sub
Private Sub bt_Ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Ok.Click
If maintain_department = "Admin" Then
if (check_fill_for_New()) then
MsgBox("nooooooooo")
end if
End If
End Sub