كود اضافة
كود الحفظ
كود الحذف
كود انتقال للسجل التالي
انتقال للسجل السابق
انتقال للسجل الاول مباشره
السجل الاخير
كود التعديل
اخي الكريم هذا كلهم بستخدام اداة Adodc اذا كنت تستخدم اداة Data1 كل ماعليك تغيير اداة Adodc الى Data1 فقط لاغير
PHP كود :
On Error Resume Next
Adodc1.Recordset.AddNew
كود الحفظ
PHP كود :
Adodc1.Recordset.Update
MsgBox "تم حفظ البيانات بنجاح", vbInformation, "حفظ"
كود الحذف
PHP كود :
On Error Resume Next
Dim m
m = (MsgBox("هل تريد حذف الموظف", vbOKCancel + vbExclamation, "حذف السجل"))
If m = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
MsgBox "تم الحذف"
Else
MsgBox "تم الغاء العملية", vbInformation, "الغاء"
End If
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox "السجل الاخير"
End If
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.Update
MsgBox "لايوجد سجلات"
End If
PHP كود :
On Error Resume Next
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
End If
انتقال للسجل السابق
PHP كود :
On Error Resume Next
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
End If
انتقال للسجل الاول مباشره
PHP كود :
On Error Resume Next
Adodc1.Recordset.MoveFirst
السجل الاخير
PHP كود :
On Error Resume Next
Adodc1.Recordset.MoveLast
كود التعديل
PHP كود :
On Error Resume Next
Adodc1.Recordset.Save
MsgBox "تم عملية التعديل بنجاح", vbInformation, "تعديل"
اخي الكريم هذا كلهم بستخدام اداة Adodc اذا كنت تستخدم اداة Data1 كل ماعليك تغيير اداة Adodc الى Data1 فقط لاغير
