09-09-19, 05:27 PM
السلام عليكم اخواني
اريد تطوير زر حفظ الفاتورة برسائل تاكيدة فتظهر رسالة خطاء في Next
ياترى ماهي المشكلة
ارجو تعديل الكود
اريد تطوير زر حفظ الفاتورة برسائل تاكيدة فتظهر رسالة خطاء في Next
ياترى ماهي المشكلة
ارجو تعديل الكود
PHP كود :
Private Sub Command1_Click()
Dim I As Integer
For I = 1 To fox.Rows - 1
If Trim$(fox.TextMatrix(I, 0)) <> "" And Val(Trim$(fox.TextMatrix(I, 0))) > 0 Then
Set RS = New ADODB.Recordset
If RS.State = adStateOpen Then RS.Close
RS.CursorLocation = adUseClient
ms = MsgBox("هل تريد بالفعل حفظ بيانات الفاتورة", vbYesNo)
If ms = vbYes Then
RS.Open "select* from BillItems ", DB, adOpenStatic, adLockPessimistic
RS.AddNew
RS!Id = Val(Trim$(fox.TextMatrix(I, 0)))
RS!Name = Trim$(fox.TextMatrix(I, 1))
RS!Qty = Val(Trim$(fox.TextMatrix(I, 3))) '3
RS.Update
DoEvents
Set RS2 = New ADODB.Recordset
If RS2.State = adStateOpen Then RS2.Close
RS2.CursorLocation = adUseClient
RS2.Open "Select * From Store Where iD=" & Val(Trim$(fox.TextMatrix(I, 0))), DB, adOpenStatic, adLockPessimistic
If RS2.RecordCount > 0 Then
RS2![noo] = RS2![noo] - Val(Trim$(fox.TextMatrix(I, 3))) '3
RS2.Update
DoEvents
MsgBox "تمت عملية حفظ الفاتورة ", vbMsgBoxRtlReading + vbInformation, "تنبية"
Else
MsgBox "لم يتم حفظ الفاتورة ", vbMsgBoxRtlReading + vbInformation, "تنبية"
Exit Sub
End If
End If
End If
Next
End Sub
اعز معلمين :
1) Ahmed _Mansoor
2) sniper.ps
3) myalsailamy
4) ahmedabdelaliem
5) sendbad100
6)Amir_alzubidy
1) Ahmed _Mansoor
2) sniper.ps
3) myalsailamy
4) ahmedabdelaliem
5) sendbad100
6)Amir_alzubidy

