هذا الكود يعطى حطأ عند عملية التعديل على أى قرار
فما الخطأ فى هذا الكود
ولكم التحية
If Trim(Text2.Text) = "" Then
MsgBox "عفوا يجب إدخال رقم القرار", vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "Message"
Text2.SetFocus
End If
If rs.State = 1 Then rs.Close
rs.Open "select * from gen where num ='" & Trim(Text2.Text) & "'", db, adOpenKeyset, adLockPessimistic
If rs.RecordCount <> 0 Then
MsgBox "هذا القرار موجود بالفعل .. هل تريد المتابعة"
End If
If MsgBox("هل تريد حفظ القرار الحالى", vbQuestion + vbMsgBoxRight + vbMsgBoxRtlReading + vbYesNoCancel, "ÑÓÇáÉ") = vbYes Then
With rs
If AddOREdit = True Then .AddNew
rs("code") = Text1.Text
rs("num") = Text2.Text
rs("kind") = Combo1.Text
rs("source") = Text4.Text
rs("tex") = Text5.Text
rs("notes") = Text6.Text
.Update
End With
Call SwitchOnOffButton(True)
Call ViewRecord
Call LENRecord
Call Form_Load
MsgBox "تمت عملية الحفظ بنجاح", vbInformation + vbMsgBoxRight + vbMsgBoxRtlReading, "ÑÓÇáÉ"
End If
Exit Sub
End Sub