14-06-18, 04:45 PM
كود :
On Error Resume Next: Err.Clear
If Trim(ComboBox.Text) = "" Then
MsgBox "يجب اختيار الاسم أولاً", vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "تنبيه"
Exit Sub
End If
Dim sure
sure = MsgBox("هل تريد بالتأكيد حذف السجل ¿", vbInformation + vbYesNo + vbMsgBoxRight + vbMsgBoxRtlReading, "تأكيد الحذف")
If sure = vbYes Then
'
If DB.State = adStateClosed Then Call ConnectionDatabase
DB.Execute "Delete From Table1 where Name = '" & Trim(ComboBox.Text) & "'"
DoEvents
MsgBox "تمت العملية بنجاح", vbOKOnly + vbInformation + vbMsgBoxRight, "حذف سجل"
End If
'
Call Form_Loadحيث Table1 اسم الجدول
و Name اسم الحقل
إذا طُعِنتَ من الخلفِ فاعلمْ أنك في المقدمةِ

