دوباره سلام و...
سلام
شما توی else آخر هم باید اطلاعات رو ذخیره کنید هم eror.clear() رو اجرا کنید
دوباره اخطار ها رو پاک نمی کنه!
Private Sub Insert()
Dim eror As New ErrorProvider
eror.Clear()
If txtcode.Text = "" Then
eror.SetError(txtcode, "کد کتاب را وارد کنید")
ElseIf txttitle.Text = "" Then
eror.SetError(txttitle, "عنوان کتاب را وارد کنید")
ElseIf txtmoalef.Text = "" Then
eror.SetError(txtmoalef, "مولف کتاب را وارد کنید")
ElseIf txttranslate.Text = "" Then
eror.SetError(txttranslate, "مترجم کتاب را وارد کنید")
ElseIf txtnasher.Text = "" Then
eror.SetError(txtnasher, "ناشر کتاب را وارد کنید")
ElseIf txtprint.Value = 0 Then
eror.SetError(txtprint, "شماره چاپ کتاب را وارد کنید")
ElseIf txtpage.Value = 0 Then
eror.SetError(txtpage, "تعداد صفحات کتاب را وارد کنید")
ElseIf txttotal.Value = 0 Then
eror.SetError(txttotal, "تعداد موجودی کتاب را وارد کنید")
Else '*************************
Dim bind As New Bind
bind = New Bind
bind.Bind(dgv, "select b_code from TBL_Book where b_code=" & txtcode.Text)
If dgv.RowCount > 1 Then
MessageBoxEx.EnableGlass = False
MessageBoxEx.Show(". این کد کتاب قبلا ثبت شده است" & vbCrLf & ". لطفا کد کتاب را تغییر دهید ", "خطا در ثبت اطلاعات", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Else
'ثبت داده ها
eror.Clear() 'پاک کردن اخطار ها
End If
End If
End Sub