السلام عليكم
أريد من حضرتكم المساعدة
في التعديل على كود الخروج من نموذج "فاتورة مبيعات" التالي :
If IsNull(Me.Text15) And IsNull(Me.TotalAmount) Then
DoCmd.SetWarnings (False)
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings (True)
DoCmd.Close
Else
DoCmd.Close
End If
If IsNull(Me.Text15) Then
DoCmd.SetWarnings (False)
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings (True)
DoCmd.Close
Else
Dim Msg, style, title, result
Msg = "هل تريد حفظ الفاتورة الحالية"
style = vbYesNo
title = " تنبيه"
result = MsgBox(Msg, style, title)
If result = vbYes Then
[TotalAmount] = [Text17]
[Descount] = [Text15] - [Text17]
MsgBox "تم الحفظ سيتم الخروج", vbInformation, "تنبيه"
DoCmd.Close
Else
If result = vbNo Then
DoCmd.SetWarnings (False)
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings (True)
MsgBox "تم حذف الفاتورة الحالية", vbInformation, "مع السلامة"
DoCmd.Close
End If
End If
End If
الفواتير2.rar