biskra قام بنشر مايو 6, 2004 مشاركة قام بنشر مايو 6, 2004 Private Sub cmdPrint5_Click() On Error Resume Next DoCmd.RunCommand acCmdSaveRecord Dim stDocName As String Dim intResponseToMsgBox As Integer intResponseToMsgBox = MsgBox("تأكد من أن الطابعة جاهزة ", vbOKCancel) If intResponseToMsgBox = vbOK Then DoCmd.OpenReport "affichage", acViewPreview, WhereCondition:=" PrintYesNo = False and notification=false " DoCmd.SetWarnings False DoCmd.SelectObject acReport, "affichage" DoCmd.PrintOut acPages, , , , 2 DoCmd.Close acReport, "affichage" DoCmd.RunSQL "Update tbl1 set PrintYesNo = true where PrintYesNo = false " DoCmd.SetWarnings True End If End Sub هذا الكود أستعمله بواسطة زر أمر للطباعة على نموذج, فهو يطبع التقريرaffichage متى توفرت الشروط المرتبطة, أضفت له خاصية طباعة التقارير على نسختين بواسطة الأمر DoCmd.PrintOut acPages, , , , 2, الأمر الى حد الآن سليم, فكلما أدخلت البيانات ثم عند الضغط على الزر للطباعة ينفذ الأمر لكن المشكلة تظهر عند الضغط على هذا الزر في حالة عدم وجود البيانات, فعوض أن ينفذ الأمر المرتبط بعدم وجود البيانات في التقرير فاٍنه يقوم بطباعة النموذج بعدد السجلات الموجودة مضروبة في 2 !!!!! هل من مساعدة لتجاوز هذه المشكلة. رابط هذا التعليق شارك More sharing options...
Access XP قام بنشر مايو 6, 2004 مشاركة قام بنشر مايو 6, 2004 أضف شرطا لفتح التقرير ... ليكن مثلا رقم السجل مثال Private Sub cmdPrint5_Click() On Error Resume Next DoCmd.RunCommand acCmdSaveRecord Dim stDocName As String Dim intResponseToMsgBox As Integer intResponseToMsgBox = MsgBox("تأكد من أن الطابعة جاهزة ", vbOKCancel) If intResponseToMsgBox = vbOK Then DoCmd.OpenReport "affichage", acViewPreview, , "SerialNo = forms!MyForm!SerialNo" WhereCondition:=" PrintYesNo = False and notification=false " DoCmd.SetWarnings False DoCmd.SelectObject acReport, "affichage" DoCmd.PrintOut acPages, , , , 2 DoCmd.Close acReport, "affichage" DoCmd.RunSQL "Update tbl1 set PrintYesNo = true where PrintYesNo = false " DoCmd.SetWarnings True End If End Sub رابط هذا التعليق شارك More sharing options...
biskra قام بنشر مايو 6, 2004 الكاتب مشاركة قام بنشر مايو 6, 2004 هذا مثال عن المشكلة db16.rar رابط هذا التعليق شارك 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.