Dim cmd As New OleDbCommand
ApoSYSconn.Close()
cmd.Connection = ApoSYSconn
ApoSYSconn.Open()
cmd.CommandText = "Select * from tblCustomers where CivilRegNum=@n"
cmd.Parameters.AddWithValue("@n", txtCRN.Text)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.HasRows = True Then
MessageBox.Show("هذا السجل موجود", "تحذير", MessageBoxButtons.OK, MessageBoxIcon.Warning)
txtCRN.Text = ""
txtCRN.Focus()
txtCRN.SelectionStart = 0
ApoSYSconn.Close()