01-03-14, 02:48 PM
شف الكود هذا:
كود :
If Me.TextBox1.Text.Trim.Length = 0 Then
Me.TextBox1.Focus()
MsgBox(" الرجاء ادخال اسم الموظف ", MsgBoxStyle.Critical + MsgBoxStyle.MsgBoxRight, " خطاء في الاتصال ")
Exit Sub
End If
Dim Check As New OleDbCommand("select * from Tab where N like '" & TextBox1.Text.Trim & "' ", con)
Dim Checknum As String = ""
con.Open()
Checknum = Check.ExecuteScalar
con.Close()
If Checknum <> "" Then
MsgBox(" عفواً هذا الموظف سبق تسجيله في النظام ", MsgBoxStyle.Critical + MsgBoxStyle.MsgBoxRight, " خطاء في الاتصال ")
Exit Sub
End If