jamal2080 قام بنشر أكتوبر 4, 2023 مشاركة قام بنشر أكتوبر 4, 2023 اريد تعديل الكود لان يوجود خطاء لم اتمكن من حل المشاكل .... Private Sub cmdpro_04_Click() On Error Resume Next Dim reports() As Variant Dim i As Integer ' تعريف أسماء التقارير reports = Array("Month_RQ", "Month_RQ_01", "Month_RQ_02", "Month_RQ_03") ' فحص وجود بيانات في كل تقرير قبل فتحه For i = LBound(reports) To UBound(reports) If ReportHasData(reports(i)) Then DoCmd.OpenReport reports(i), acViewPreview Else MsgBox "لا توجد بيانات لفتح التقرير: " & reports(i) End If Next i End Sub ' دالة للتحقق من وجود بيانات في تقرير محدد Function ReportHasData(reportName As String) As Boolean On Error Resume Next Dim RS As Recordset ' فتح التقرير واستنساخ السجلات Set RS = reports(reportName).RecordsetClone ' التحقق من وجود سجلات If Not RS.EOF Then ReportHasData = True End If ' إغلاق السجلات RS.Close Set RS = Nothing End Function رابط هذا التعليق شارك More sharing options...
kkhalifa1960 قام بنشر أكتوبر 4, 2023 مشاركة قام بنشر أكتوبر 4, 2023 أين المرفق ؟ رابط هذا التعليق شارك More sharing options...
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.