اذهب الي المحتوي
أوفيسنا

محمدفتاح

02 الأعضاء
  • Posts

    61
  • تاريخ الانضمام

  • تاريخ اخر زياره

مشاركات المكتوبه بواسطه محمدفتاح

  1. السلام عليكم كل عام والجميع بخير 

    لقد نفذت طريقة غلق النموذج عند فتح التقرير وعند غلق التقرير افتح النموذج مرة اخرى هل يوجد طريقة لفتح النموذج وهو محتفظ بالبيانات التي تم اختيارها لفتح تقرير معين لان عند فتح النموذج تكون الحقول فارغة واقوم بتحديد الاختيارات مرة اخرى 

  2. السلام عليكم جزاكم الله خيرا DoCmd.Maximize في التقرير معمولة بالفعل ومع ذلك يحدث هذا الامر سوف اجرب الجل الاخر ان شاء الله وشكرا لوقتكم الثمين 

    ومع العلم هذا الامر لا يحدث في جميع الاحوال ولكن في بعض الاحيان يحدث كما ذكرت واضطر لغلق القاعدة واعادة فتحها

  3. قمت نتصميم قاعدة ويوجد نموذج اساسي وعند الضغط على مفتاح يفتح نموذج فرعي وخاصية النموذج القرعي منبثق نعم ولكن عند فتح تقرير من خلال النموذج الفرعي يذهب التقرير والنموذج الفرعي خلف النموذج الرئيسي واضطر الى اغلاق القاعدة وفتحها مرة اخرى فما حل هذه المشكلة شكرا 

  4. السلام عليكم اولا جزاكم الله خيرا

    ثانيا حل هذه الرسالة هو فتح اي تقرير في وضع التصميم ومن شريط العناوين نقوم باغلاق التجميع والفرز واغلاق التقرير مع الحفظ في هذه الحالة عند استخدام الكود لا تظهر هذه الرسالة مرة اخري 

  5. Database1.rarللاسف حاولت اعمل نموذج صغير وحاولت ارفعه ظهرت رسالة ان الحجم اكبر من المسموح احاول اوضح المشكلة مرة اخرى هذه الطريقة في انشاء التقرير بالكود استخدمتها من قبل وكانت فعالة جدا ولم تظهر هذه المشكلة من قبل في هذه المرة تم انشاء التقرير فعلا ولكن يظهر سجل واحد فقط وبعد فتح التقرير في وضع التصميم وحذف التقارير الفرعية ولصقها مرة اخرى تظهر جميع السجلات وسوف ارسل لكم صورة لشكل التقرير لعلها توضح المشكلة للاسف ظهرت نفس الرسالة ان الحجم كبير

    سامحوني لم يخطر على بالي ان اقوم بضغطها فهذا هو النموذج الصغير بعد اذنكم قوموا بفتح النموذج ثم انشاء التقرير ولاحظوا النتيجة ثم فتح التقرير في وضع التصميم وحذف التقارير الفرعية واعادة لصقها واعرض التقرير مرة اخرى ستظهر جميع السجلات هذه هى مشكلتي جعلكم الله عونا لي والاخرين آمين

    Database1.rar

  6. للاسف حاولت اعمل نموذج صغير وحاولت ارفعه ظهرت رسالة ان الحجم اكبر من المسموح احاول اوضح المشكلة مرة اخرى هذه الطريقة في انشاء التقرير بالكود استخدمتها من قبل وكانت فعالة جدا ولم تظهر هذه المشكلة من قبل في هذه المرة تم انشاء التقرير فعلا ولكن يظهر سجل واحد فقط وبعد فتح التقرير في وضع التصميم وحذف التقارير الفرعية ولصقها مرة اخرى تظهر جميع السجلات وسوف ارسل لكم صورة لشكل التقرير لعلها توضح المشكلة للاسف ظهرت نفس الرسالة ان الحجم كبير

  7. السلام عليكم جعلكم الله بخير جميعا

    قمت بعمل تقرير فرعي من خلال الكود ثم انشأت تقرير اساسي بنفس الطريقة وقمت برط التقرير الفرعي بالاساسي من خلال حقلين  عند عرض التقرير لا يظهر غير سجل واحد وعند فتح التقرير الاساسي في وضع التصميم وحذف التقرير الفرعي وأعادة لصقه بدون اي تغييرات واقوم بعرض التقرير الاساسي مرة اخرى تظهر جميع السجلات ولا اعرف السبب وقمت بتكرار هذه العملية اكثر من مرة ولكن دون جدوي  افيدونا افادكم الله ما حل هذه المشكلة  

  8. السلام عليكم 

    ارجو من سيادتكم الافادة عندي جهاز لاب توب وكان عليه نسخة ويندوز 7 واوفيس 2007 عربي وكان اختيار تصدير التقرير ال بي دي اف متاح وقمت بتصديره اكثر من مرة الان عندما اقوم بعمل تصدير لا يوجد اختيار ال بي دي اف من اختيارات التصدير فبحثت على النت وتوصلت لكود التحويل الي ال بي دي اف تظهر رسالة تقول التنسيق الذي تحاول اخراج الكائن الحالي به غير متوفر قمت باعادة تنصيب ويندوز 7 مرة اخري والاوفيس ايضا ولكن للاسف المشكلة مازالت موجودة فما الحل زادكم الله من علمه ونفع به الناس اجمعين شكرا

  9.  

     

    strReportName = "rpt"
    strSQL = "SELECT * FROM basicdata ORDER BY student_name;"
    If DCount("[Name]", "MSysObjects", "[Name] = 'rpt'") = 1 Then
    DoCmd.DeleteObject acReport, "rpt"
    End If
    Set rptCustomers = CreateReport
    With rptCustomers
    .RecordSource = strSQL
    .Section("ÊÝÕíá").Height = 0.7 * 567
    '.Report.Width = 19.8 * 567
    '.Section("PageHeadersection").Height = 4.8 * 567
    '.Section("Pagefootersection").Height = 2 * 567
    .Report.DefaultView = 0
    .Report.PopUp = True
    .Caption = "ßÔÝ ÑÕÏ ÇáÔåæÑ"
    End With
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "class", 0.5 * 567, 0.2 * 567, 3 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 3.5 * 567, 0.2 * 567, 2 * 567, 0.6 * 567)
    lblLabel.Caption = "ÇáÕÜÜÜÝ :": lblLabel.TextAlign = 2: lblLabel.FontSize = 11
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "gover", 14 * 567, 0.2 * 567, 4 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 18 * 567, 0.2 * 567, 1.8 * 567, 0.6 * 567)
    lblLabel.Caption = "ãÍÇÝÙÉ :": lblLabel.TextAlign = 2: lblLabel.FontSize = 11
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "classroom", 0.5 * 567, 0.8 * 567, 3 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 3.5 * 567, 0.8 * 567, 2 * 567, 0.6 * 567)
    lblLabel.Caption = "ÇáÝÕÜÜá :": lblLabel.TextAlign = 2: lblLabel.FontSize = 11
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "directorate", 14 * 567, 0.8 * 567, 4 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 18 * 567, 0.8 * 567, 1.8 * 567, 0.6 * 567)
    lblLabel.Caption = "ÇáÅÏÇÑÉ :": lblLabel.TextAlign = 2: lblLabel.FontSize = 11
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "school", 14 * 567, 1.4 * 567, 4 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 18 * 567, 1.4 * 567, 1.8 * 567, 0.6 * 567)
    lblLabel.Caption = "ÇáãÏÑÓÜÉ :": lblLabel.TextAlign = 2: lblLabel.FontSize = 11
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "='ÕÝÍÉ' & [Page] & ' ãä ' & [Pages]", 9 * 567, 0, 3 * 567, 0.6 * 567)
     txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 2 * 567, 1.9 * 567, 12.5 * 567, 0.8 * 567)
    lblLabel.Caption = "  ßÔÝ ÑÕÏ ÏÑÌÇÊ ÇÚãÇá ÇáÓäÉ ááÝÕá ÇáÏÑÇÓí": lblLabel.TextAlign = 3: lblLabel.FontSize = 14: lblLabel.BorderStyle = 1: lblLabel.BorderWidth = 1: lblLabel.BackStyle = 1: lblLabel.BackColor = RGB(211, 211, 211): lblLabel.TopMargin = 0.1 * 567
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "term", 5.2 * 567, 2 * 567, 1.5 * 567, 0.6 * 567): txtTextBox.BackColor = RGB(211, 211, 211): txtTextBox.FontSize = 14: txtTextBox.TextAlign = 3
    Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acPageHeader, , "year", 2.2 * 567, 2 * 567, 3 * 567, 0.6 * 567):  txtTextBox.BackColor = RGB(211, 211, 211): txtTextBox.FontSize = 14: txtTextBox.TextAlign = 3
    For jj = 0 To 2
    For ii = 0 To 16
    If jj = 0 And (ii < 3) Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , ii * 567, 2.8 * 567, 1 * 567, 1.4 * 567)
    If jj = 0 And (ii = 3 Or ii = 7 Or ii = 11) Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , ii * 567, 2.8 * 567, 4 * 567, 0.6 * 567)
    If jj = 0 And (ii = 15) Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , ii * 567, 2.8 * 567, 4 * 567, 2 * 567)
    If jj = 0 And (ii = 16) Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , 19 * 567, 2.8 * 567, 0.8 * 567, 2 * 567)
    If jj = 1 And (ii > 2 And ii < 15) Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , ii * 567, 3.4 * 567, 1 * 567, 0.8 * 567)
    If jj = 2 And ii < 15 Then: Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageHeader, , , ii * 567, 4.2 * 567, 1 * 567, 0.6 * 567)
    lblLabel.BorderStyle = 1: lblLabel.BorderWidth = 1
    If jj = 0 And ii = 0 Then: lblLabel.Caption = "ÊÑã Çæá": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 0 And ii = 1 Then: lblLabel.Caption = "ãÊæÓØ ÇáÏÑÌÉ": lblLabel.TextAlign = 2: lblLabel.FontSize = 10: lblLabel.TopMargin = 0.2 * 567
    If jj = 0 And ii = 2 Then: lblLabel.Caption = "ÇáãÌãæÚ Çáßáí": lblLabel.TextAlign = 2: lblLabel.FontSize = 9: lblLabel.TopMargin = 0.2 * 567
    If jj = 0 And ii = 3 Then: lblLabel.Caption = "ÔåÑ ÏíÓãÈÑ": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 0 And ii = 7 Then: lblLabel.Caption = "ÔåÑ äæÝãÈÑ": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 0 And ii = 11 Then: lblLabel.Caption = "ÔåÑ ÇßÊæÈÑ": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 0 And ii = 15 Then: lblLabel.Caption = "ÇáÇÓÜÜÜÜã": lblLabel.TextAlign = 2: lblLabel.FontSize = 12: lblLabel.TopMargin = 0.6 * 567
    If jj = 0 And ii = 16 Then: lblLabel.Caption = "ã": lblLabel.TextAlign = 2: lblLabel.FontSize = 12: lblLabel.TopMargin = 0.6 * 567
    If jj = 1 And (ii = 3 Or ii = 7 Or ii = 11) Then: lblLabel.Caption = "ÇáãÌãæÚ": lblLabel.TextAlign = 2: lblLabel.FontSize = 8: lblLabel.TopMargin = 0.2 * 567
    If jj = 1 And (ii = 4 Or ii = 8 Or ii = 12) Then: lblLabel.Caption = "ÊÞæíãÇÊ ÔÝåíÉ": lblLabel.TextAlign = 2: lblLabel.FontSize = 9
    If jj = 1 And (ii = 5 Or ii = 9 Or ii = 13) Then: lblLabel.Caption = "ãåÇã ÌãÇÚíÉ": lblLabel.TextAlign = 2: lblLabel.FontSize = 9
    If jj = 1 And (ii = 6 Or ii = 10 Or ii = 14) Then: lblLabel.Caption = "ãåÇã ÝÑÏíÉ": lblLabel.TextAlign = 2: lblLabel.FontSize = 9
    If jj = 2 And (ii = 0) Then: lblLabel.Caption = "100": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 2 And (ii = 1) Then: lblLabel.Caption = "70": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 2 And (ii = 2) Then: lblLabel.Caption = "210": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 2 And (ii = 3 Or ii = 7 Or ii = 11) Then: lblLabel.Caption = "70": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 2 And (ii = 4 Or ii = 8 Or ii = 12) Then: lblLabel.Caption = "20": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If jj = 2 And (ii = 5 Or ii = 9 Or ii = 13 Or ii = 6 Or ii = 10 Or ii = 14) Then: lblLabel.Caption = "25": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    Next
    Next
    For ii = 0 To 16
    If ii < 15 Then: Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acDetail, , "", ii * 567, 0, 1 * 567, 0.7 * 567): txtTextBox.BorderStyle = 1: txtTextBox.BorderWidth = 1: txtTextBox.FontSize = 11: txtTextBox.TextAlign = 2
    If ii = 15 Then: Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acDetail, , "student_name", ii * 567, 0, 4 * 567, 0.7 * 567): txtTextBox.BorderStyle = 1: txtTextBox.BorderWidth = 1: txtTextBox.FontSize = 11: txtTextBox.TextAlign = 3
    If ii = 16 Then: Set txtTextBox = CreateReportControl(rptCustomers.Name, acTextBox, acDetail, , "=1", 19 * 567, 0, 0.8 * 567, 0.7 * 567): txtTextBox.BorderStyle = 1: txtTextBox.BorderWidth = 1: txtTextBox.FontSize = 11: txtTextBox.TextAlign = 2: txtTextBox.RunningSum = 1
    Next
    For ii = 0 To 3
    Set lblLabel = CreateReportControl(rptCustomers.Name, acLabel, acPageFooter, , , (1 * 567) + (ii * 4.5 * 567), 0, 4.5 * 567, 0.6 * 567)
    If ii = 0 Then: lblLabel.Caption = "ãÏíÑ ÅÏÇÑÉ ÇáãÏÇÑÓ": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If ii = 1 Then: lblLabel.Caption = "ãæÌå ÇáãÇÏÉ": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If ii = 2 Then: lblLabel.Caption = "ÑÆíÓ ÇáÞÓã": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    If ii = 3 Then: lblLabel.Caption = "ãÏÑÓ ÇáÝÕá": lblLabel.TextAlign = 2: lblLabel.FontSize = 12
    Next
    DoCmd.Save , strReportName
    DoCmd.Close
    DoCmd.OpenReport "rpt", acViewLayout
     Dim varGroupLevel As Variant
      varGroupLevel = CreateGroupLevel("rpt", "classroom", True, True)
     Reports!rpt.Section(acGroupLevel1Header).Height = 0
    Reports!rpt.Section(acGroupLevel1Footer).Height = 0
    Reports!rpt.Section(acGroupLevel1Header).ForceNewPage = 1
    Reports!rpt.Section("PageHeadersection").Height = 4.8 * 567
    Reports!rpt.Section("Pagefootersection").Height = 2 * 567
    Reports("rpt").Width = 19.8 * 567
    DoCmd.Save , strReportName
    DoCmd.Close
    
    DoCmd.OpenReport "rpt", acViewPreview
    Reports("rpt").Printer.Orientation = acPRORPortrait
    'Reports("rpt").Width = 19.8 * 567
    Reports("rpt").Printer.TopMargin = 1 * 567
    Reports("rpt").Printer.LeftMargin = 0.5 * 567
    Reports("rpt").Printer.RightMargin = 0.5 * 567
    Reports("rpt").Printer.PaperSize = acPRPSA4
    DoCmd.Maximize


    انا اولا بحاول تعلم استخدام vba في انشاء النموذج والتقرير (بحاول اتقان استخدام الاكواد) 

    الكود السابق يقوم بانشاء تقرير وفعلا يقوم بانشاؤه باستثناء عملية انشاء group level وعلي فكرة الكود فعال ويتم انشاء group level ولكن تؤثر علي عرض التقرير فهل هذه المشكلة لها حل ام لا

  10. DoCmd.OpenReport "rpt", acViewLayout
     Dim varGroupLevel As Variant
      varGroupLevel = CreateGroupLevel("rpt", "classroom", True, True)
     Reports!rpt.Section(acGroupLevel1Header).Height = 0
    Reports!rpt.Section(acGroupLevel1Footer).Height = 0
    Reports!rpt.Section(acGroupLevel1Header).ForceNewPage = 1
    لقد قمت باستخدام هذا الكود لعمل تجميع للبيانات في التقرير ولكن تحذث مشكلة بعد انشاء التقرير وعمل هذا التجميع يتغير عرض التقرير تقريبا الي الضعف يعتي انا محدد عرض صفحة التقرير 19 اجد عرض الصفحة بعد انشاء التجميع 38 وحاولت تحدير عرض التقرير بعد انشاء التجميع الي 19 ولكن لا يستجيب ويجعل العرض 38 فما حل هذه المشكلة شكرا

  11. بالنسبة للجزئية رابعا اود ان اعتذر لاني لم احاول بالقدر الكافي لاني اخذت الجزء الخاص بالاجراء ولم اكتب الكود Set mode = frm.Module اولا فعندما كتبته اولا قام الكود بآداء المهمة جزاكم الله خيرا وانتظر ردكم علي باقي الاستفسارات وشكرا

     

  12. السلام عليكم كل عام وانتم بخير اريد الرد علي بعض التفسيرات للاستفادة من خبرتكم الطويلة في عالم الاكسس

    اولا تجهيز فورم او التقرير من خلال المعالج افضل ام من خلال الكود في vba لان في بعض تعليقاتكم ان هذه الاوامر لن تشتغل في صيغة mde  

    ثانيا ما سبب اختلاف تنسيق تقرير عند نقل قاعدة البيانات علي جهاز اخر بل علي نفس الجهاز عند تنزيل نسخة جديدة

    ثالثا انا اريد تعلم الاكسس واتقانه فما الطريق الصحيح لاتمام هذه المهمة

    رابعا الاخ جعفر قد انزلت مسقط التصفح هذا وللاسف لم يشتغل عندي نهائيا وفتحت الوحدات النمطية واخذت منها الجزء اللذي اريده وللاسف لم تنجح المحاولة انا سؤالي كيف اربط بين الزر والحدث وجزاكم الله جميعا عني خيرا واسف علي الاطالة

  13. اكتب هذا الكود وهو 

    Function creat_form()
    Dim frmCustomers As Access.Form
    Dim strfrmName As String
    Dim aoAccessObj As AccessObject
    Dim txtTextBox As Access.TextBox
    Dim lblLabel As Access.Label
    Dim cmd As Access.CommandButton
    Dim compo As Access.ComboBox
    Dim strSQL As String
    Dim ctrl As Variant
    
    If frmcod_r = 1 Then
    strfrmName = "frm"
    strSQL = "SELECT class FROM class;"
    
    If DCount("[Name]", "MSysObjects", "[Name] = 'frm'") = 1 Then
    DoCmd.DeleteObject acForm, "frm"
    End If
    Set frmCustomers = CreateForm
    With frmCustomers
    .RecordSource = strSQL
    .Section("ÊÝÕíá").Height = 10 * 567
    .Form.Width = 15 * 567
    '.Section("ÑÃÓ ÇáÕÝÍÉ").Height = 3 * 567
    '.Section(1).Height = 3 * 567
    
    .Form.DefaultView = 2
    .Form.Orientation = 1
    .Form.CloseButton = True
    .Form.MinMaxButtons = False
    .Form.PopUp = True
    '.Report.PopUp = True
    .Caption = "password"
    End With
    'Set txtTextBox = CreateForm(
    Set txtTextBox = CreateControl(frmCustomers.Name, acTextBox, ac, , "", 1 * 567, 1 * 567, 6 * 567, 1 * 567)
     txtTextBox.FontSize = 12
    txtTextBox.TextAlign = 2
    'txtTextBox.BorderStyle = 1
    'txtTextBox.BorderWidth = 2
    Set compo = CreateControl(frmCustomers.Name, acComboBox, acDetail, , "class", 1 * 567, 3 * 567, 6 * 567, 1 * 567)
    compo.RowSourceType = "table/query"
    compo.RowSource = "class"
    compo.LimitToList = True
    compo.TextAlign = 2
     compo.FontSize = 14
    'compo.BorderStyle = 1
    'compo.BorderWidth = 2
    Set frm = Application.Forms(1)
    Set cmd = CreateControl(frmCustomers.Name, acCommandButton, acDetail, , "", 1 * 567, 5 * 567, 4 * 567, 1 * 567)
    cmd.Caption = "موافق": cmd.Name = "cmd1"
    cmd.OnClick = "event presdure"
    DoCmd.Save , strfrmName
    DoCmd.Close
    DoCmd.OpenForm "frm", acNormal
    End If
    End Function


    المشكلة الكود يقوم فعلا بانشاء النموذج ولكن كيف اقوم بكتابة الاجراء المراد تنفيذه داخل زر الامر حاولت مرارا وتكرارا ولكن لم يحالفني الحظ افيدوني جزاكم الله خيرا وزادكم علما وشكرا 

  14. هل يوجد اصلا كود في vba لعرض التقرير في عمودين يعني ارقام جلوس الطلاب يمكن عرض 6 ارقام جلوس في الصفحة وبصراجة بحثت كثيرا علي حل هذه المشكلة فلم اصل بعد فهل يمكن حل هذه المشكلة في vba وارجوكم انا اعرف الحل من خلال النوافذ (اعدادت الصفحة ثم اختيار الاعمدة وهكذا ) ولكن لا اريد هذا الحل لاني انشئ التقرير بالكود فهل يوجد كود يحل هذه المشكلة وشكرا ةاسف علي الاطالة

  15. انا اقوم بعمل الاستعلام من خلال vba وذلك من خلال الكود 

    Dim db As DAO.Database
    Dim sqry As DAO.QueryDef
    Set db = CurrentDb
    If DCount("[Name]", "MSysObjects", "[Name] = 'basicdata'") = 1 Then
    "DoCmd.DeleteObject acQuery, "basicdata"
    End If
    ("Set sqry = db.CreateQueryDef("basicdata
    sqry.SQL = "SELECT  classroom FROM students WHERE ((class='" & Me.txt & "'))   ORDER BY kind,student_name

    qry.Close
    db.Close
    Set sqry = Nothing
    Set db = Nothing
    Application.RefreshDatabaseWindow

    Application.RefreshDatabaseWindow

    فعند الجملة sqry.sql اقوم بتسجيل الحقول التي اريدها وتبدأ الجملة بكلمة select كما تعلم فالعبارة كانت طويلة جدا فأردت تقسيمها ونفذت طريقتكم الجميلة ولكن عند الجملة sqry.sql كيف اضيف المتغير في الجملة وشكرا

    
     
  16. اريد تقسيم هذا الكود 

    sqry.SQL = "SELECT setdown_no, [arabic*-], arabic,iif([arabic]='Û','Û',Val([arabic*-])+Val([arabic])) AS ta, [mathematics*-], mathematics,iif([mathematics],'Û','Û',Val([mathematics*-])+Val([mathematics])) AS tm, [sociability_studies*-], sociability_studies,iif([sociability_studies],'Û','Û',Val([sociability_studies*-])+Val([sociability_studies])) AS tso, [sciences*-],[sciences*1], sciences,iif([sciences],'Û','Û',Val([sciences*-])+Val([sciences])+Val([sciences*1])) AS tsc, [foreign_language*-], foreign_language,iif([foreign_language],'Û','Û',Val([foreign_language*-])+Val([foreign_language])) AS te, [religion_education*-], religion_education,on],'Û','Û',Val([religion_education*-])+Val([religion_education])) AS trel, [advanced_english*-], advanced_english1 ,iif([],'Û','Û',Val([advanced_english*-])+Val([advanced_english1])) AS tad,tblbasicdata.class FROM students INNER JOIN tblbasicdata ON students.class = tblbasicdata.class  WHERE ((tblbasicdata.class='" & Me.txt & "')) ORDER BY setdown_no;"
     

    هذا الكود مكتوب في سطر واحد ولا اعرف طريقة تقسيمه افيدونا افادكم الله

  17. السلام عليكم اولا جزاكم الله خيرا ولكن ليس هذا مقصدي اريد التحكم هذا يتم من خلال الكود لاني كما ذكرت اقوم بتصميم  التقرير من خلال الكود وليس باستخدام النوافذ والهدف من ذلك اريد تقليل عدد التقارير فاستخدم تقرير واحد واعدل خصائصه ومحتوياته بالكود حسب الحاجة فأرجو الافادة ان امكن وجزاكم الله خير علي الاهتمام والمساعدة شكرا مرة ثانية 

  18. السلام عليكم كل عام وانتم بخير جميعا وبعد

    اريد عمل تقرير بالكود والحمد لله توصلت الى الطريقة وحتي لا اطيل عليكم اريد التحكم في اعدادت الصفحة ايضا بالكود ولكن واجهتني مشكلة اولا عمل تجميع للبيانات مثلا عن طريق الصف الدراسي( لاني اعمل بالتدريس ) وايضا التحكم في عرض اكثر من عمود في  الصفحة ( التقرير عبارة عن عمود واحد ) فعرض اكثر من عمود في الصفحة يقلل عدد الورق وتوصلت الي اكواد مثل

    Reports("rpt").Printer.Orientation = acPRORLandscape 'ÃÝÞí
    'Reports("rpt").Printer.Orientation = acPRORPortrait 'ÚãæÏí
    Reports("rpt").Printer.TopMargin = 567 * 3
    Reports("rpt").Printer.ColumnSpacing = 2
    Reports("rpt").Printer.ColumnSpacing = 567 * 2.

    Reports("rpt").Printer.RowSpacing = 567 * 2

    ولكن لا اعرف كيف يمكن عرض عمودين في الصفحة افيدونا افادكم الله واسف علي الاطالة وجزاكم الله خيرا شكرا

×
×
  • اضف...

Important Information