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

ابو جودي

أوفيسنا
  • Posts

    6,503
  • تاريخ الانضمام

  • Days Won

    167

Community Answers

  1. ابو جودي's post in توسيط النماذج على طريقة أبو جودي مع إخفاء إطار أكسس. was marked as the answer   
    للاسف مع الاخفاء لابد من ان تكون  
    Pou Up = yes
    Modal = YES
    لكل النماذج والتقارير
    ولا انصحك باعتماد كود اخفاء اطار الاكسس هذا
  2. ابو جودي's post in كيف اكتب Between 50 and 80 was marked as the answer   
    وممكن 

     
    SELECT VAL([ID]) AS valID, * FROM tblEmployees WHERE VAL([ID]) BETWEEN 50 AND 80;  
    وممكن استخدام دالة CDBL لتحويل إلى رقم مزدوج (Double):
    SELECT CDBL([ID]) AS cdblID, * FROM tblEmployees WHERE CDBL([ID]) BETWEEN 50 AND 80; وممكن استخدام دالة CDATE للتحويل إلى تاريخ (إذا كان يمكن تفسير القيم كتواريخ)
    SELECT CDATE([FieldName]) AS cdateFieldName, * FROM TableName WHERE CDATE([FieldName]) Between #50# And #80#;  
  3. ابو جودي's post in طلب مساعدة في عمل استعلام لاكثر من سجل was marked as the answer   
    طيب ممكن بعد اذن استاذى الجليل ومعلمى القدير و والدى الحبيب الاستاذ @ابوخليل 
    اضيف شئ صغنون من واقع تجربة عملية سابقة لى

    اعتقد الاستعلام بدون اقواس بالشكل الاتى سوف يكون افضل
    لان استخدام الأقواس ([]) في أسماء الحقول قد يؤدي إلى مشكلات في بعض الحالات وهذا عن تجربة شخصية
    ولا يتطوع او يتبرع أحد ويسألنى عن السبب لأننى فعلا لا أعرف 
    SELECT Data1.ID, Data1.namee, Data1.edara, Data1.woork, Data1.egraa FROM Data1 WHERE (Data1.namee Like "*" & [Forms]![Data1]![Combo17] & "*") AND (Data1.egraa Like "*" & [Forms]![Data1]![Combo19] & "*");  
  4. ابو جودي's post in مشكلة حفظ البيانات على جوجل درايف was marked as the answer   
    الحل انك تعمل سطب ل جوجل درايف ع الجهاز وضع قاعدة البيانات فى مجلد جوجل الذى تم تخصيصة للمزامنة
    فى تلك الحالة انت مسكت العصا من المنتصف
    شغال Local  من المجلد عادى
    النت قطع او الكهرباء وقت ما الدنيا تظبط بمجرد ما تتم المزامنة للمجلد تترفع القاعدة
    ما فى حل غير كده 
    يا اما بقه تشترك فى سحابة اللكترونية بتدعم الاكسس وادفع كتيررررررر
  5. ابو جودي's post in مساعده في استدعاء بيانات دفعه واحده من عدة جداول بينهما علاقه الى نفس الجدول حسب التاريخ was marked as the answer   
    طيب جرب المرفق ده


     
    Goporodact_3.rar
  6. ابو جودي's post in طريقة وميض و تغيير عنوان مربع التسمية (Label) بعد الضغط على زر امر (CommandButton) بعنوان هذا الزر was marked as the answer   
    الموضوع تعبنى جدا والله وكان تحدى صعب
    احب التنويه الى شئ
    استخدام sleep اثناء العمل قد يصيب الأكسس بالتجميدوالشلل وقد يعلق فى الذاكرة
    ولذلك ابتعدت عن ضبط الاكواد من خلالها 
    واليكم نتيجة  التحدى

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

    يعنى كود ذكى وابن حلال وبيقدر يفهمنا من أول تكه على الزرار اه والله زيمبئولكم كده.. شغل فاخر من الاخر   اومااااااااااال 

    1- أكواد الوحدة النمطية
     
    Option Compare Database Option Explicit ' Constant that specifies the time interval for color flashing (in seconds) Const dblTimeInterval As Double = 0.5 ' Constant that determines the number of times the colors will flash Const intFlashCount As Integer = 5 ' Variable to track whether Label flashing should occur Public AllowFlashing ' Public variables to store default values Public btnControlDefaultColor As Long Public lblControlDefaultColor As Long Public strLblControlCaption As String Public formIsClosing As Boolean ' Public variable to store the selected button Public selectedButton As CommandButton ' Function to return the highlighted color Function ApplyHighlighted() As Long ApplyHighlighted = RGB(255, 255, 0) End Function ' Subroutine to set the button color Sub ButtonColor(ByVal frm As Form, Optional btn As CommandButton = Nothing, Optional DisableLabelChange As Boolean) ' Set the default button color if not highlighted If Not btn Is Nothing Then If btn.BackColor <> ApplyHighlighted Then btnControlDefaultColor = btn.BackColor ' Clear the previous button's highlight If Not selectedButton Is Nothing Then selectedButton.BackColor = btnControlDefaultColor End If ' Set the new button as selected and highlight it btn.BackColor = ApplyHighlighted ' Save the caption of the current button If Not DisableLabelChange Then strLblControlCaption = btn.Caption End If Set selectedButton = btn End If End Sub ' Subroutine to flash the label control Sub FlashLabelControl(frm As Form, lblControl As Object, DisableLabelChange As Boolean) On Error GoTo ErrorHandler Dim flashingColor As Long Dim flashingInterval As Single Dim flashCount As Integer Dim flashTimer As Single Dim i As Integer On Error GoTo 0 ' Turn off error trapping. On Error Resume Next ' Defer error trapping. ' Set the default label color if not highlighted If lblControl.BackColor <> ApplyHighlighted Then lblControlDefaultColor = lblControl.BackColor flashingColor = ApplyHighlighted flashingInterval = dblTimeInterval flashCount = intFlashCount ' Reset the label color to the default when the form is loaded If TypeOf lblControl Is Access.Label And Not formIsClosing Then lblControl.BackColor = lblControlDefaultColor If Not DisableLabelChange Then lblControl.Caption = strLblControlCaption End If End If flashTimer = Timer + flashingInterval ' Flash the label color For i = 1 To flashCount Do While Timer < flashTimer And Not formIsClosing DoEvents Loop ' Update the label color during the flash If TypeOf lblControl Is Access.Label And Not formIsClosing Then If AllowFlashing Then ' Check the AllowLabelCaptionChange value to determine whether to change the caption If Not DisableLabelChange Then lblControl.Caption = IIf(lblControl.Caption = strLblControlCaption, strLblControlCaption, vbNullString) End If lblControl.BackColor = IIf(lblControl.BackColor = lblControlDefaultColor, flashingColor, lblControlDefaultColor) End If End If ' Update the flash timer flashTimer = Timer + flashingInterval Next i ' Reset the label color to the default after flashing If TypeOf lblControl Is Access.Label And Not formIsClosing Then lblControl.BackColor = lblControlDefaultColor If Not DisableLabelChange Then lblControl.Caption = strLblControlCaption End If End If ' 2467 Err.Clear ' Clear Err Exit Sub ' Exit to avoid handler. ErrorHandler: ' Error-handling routine. Select Case Err.Number ' Evaluate error number. Case Is = 2467 flashCount = 0 flashTimer = 0 Exit Sub ' Exit to avoid handler. Case Else ' Handle other situations here... MsgBox Err.Number & ": " & Err.Description Resume ' Resume execution at the same line End Select End Sub ' Subroutine to change the button color and control Label flashing Sub ChangeCommandButtonColor(frm As Form, Optional lblControl As Object, Optional DisableLabelChange As Boolean) On Error GoTo ErrorHandler Dim clickedButton As CommandButton Set clickedButton = frm.ActiveControl On Error GoTo 0 ' Turn off error trapping. On Error Resume Next ' Defer error trapping. ' Clear the previous button's highlight If Not selectedButton Is Nothing Then selectedButton.BackColor = btnControlDefaultColor lblControl.Caption = "" strLblControlCaption = "" End If ' Set the new button as selected and highlight it Set selectedButton = clickedButton ' Update the label caption If Not DisableLabelChange Then strLblControlCaption = clickedButton.Caption End If ' Apply the button color and control Label flashing ButtonColor frm, clickedButton, True ' Check if lblControl is provided and is a valid object If Not lblControl Is Nothing Then AllowFlashing = Not DisableLabelChange ' Determine whether to trigger flashing lblControl.Caption = strLblControlCaption FlashLabelControl frm, lblControl, False End If Err.Clear ' Clear Err Exit Sub ' Exit to avoid handler. ErrorHandler: ' Error-handling routine. Select Case Err.Number ' Evaluate error number. Case Is = 5 Exit Sub ' Exit to avoid handler. Case Else ' Handle other situations here... MsgBox Err.Number & ": " & Err.Description Resume ' Resume execution at the same line End Select End Sub  2- الاكواد للاستخدام من خلال النموذج ولا اسهل من كده..  يا عينى ع الدلع
     
    Private Sub Form_Load() formIsClosing = False End Sub Private Sub Form_Close() formIsClosing = True End Sub Private Sub Command1_Click() ' Call the ChangeCommandButtonColor subroutine with the current form and label control (lblDisplayTitle). ChangeCommandButtonColor Me, Me.lblDisplayTitle End Sub Private Sub Command2_Click() ' Call the ChangeCommandButtonColor subroutine with the current form and label control (lblDisplayTitle). ChangeCommandButtonColor Me, Me.lblDisplayTitle End Sub Private Sub Command3_Click() ' Call the ChangeCommandButtonColor subroutine with the current form and label control (lblDisplayTitle). ChangeCommandButtonColor Me, Me.lblDisplayTitle End Sub Private Sub Command4_Click() ' Call the ChangeCommandButtonColor subroutine with the current form and label control (lblDisplayTitle). ChangeCommandButtonColor Me, Me.lblDisplayTitle End Sub Private Sub Command5_Click() ' Call the ChangeCommandButtonColor subroutine with the current form only without label control (lblDisplayTitle). ' To disable Allow Label Caption Change = True ChangeCommandButtonColor Me, Me.lblDisplayTitle, True End Sub
    معلش انا شرحت كل شئ ع الأكواد بالانجليزى طبعا مش فلسفة علشان عارف انت هتقول ايه سامعك...
    علشان العربى بيعمل مشاكل فى الاعدادت الاقليمية للغة لو مكانت مضبوطه

    بس خلاص 

    • وأخيرا المرفق
     
    FlashLabel.accdb
  7. ابو جودي's post in استعلام احدث تاريخ لكل عميل was marked as the answer   
    Documents_2.rar
  8. ابو جودي's post in مطلوب تحديث حقل في جدول بناء على مصدر بيانات مربع تحرير was marked as the answer   
    ومن قال انه يكفينى انا ؟!
    ومن قال اننى فى حل

    اعتذر عن التأخير كنت صائم
     
      

    بل روعة حياتنا هم اساتذتنا العظماء الذين اناروا افكارنا
    شكرا لكم استاذى الجليل و معلمى القدير و والدى الحبيب استاذ @ابوخليل سعادة  الحياة أن تكون بجانبك وتساندك روح طيبة وكريمة تمنحك وتهديك الفرح والسرور وتدخل على نفوس من حولها الفرح و السعادة
    ولا أزكيكم على الله وكل اساتذتنا المبجلين كل كلمات ومعان الشكر والعرفان بالجميل لا تكفيكم وتوفيكم قدر حقكم 
    بارك الله لكم فى عمركم وفى علمكم و عملكم واهلكم وأسال الله تعالى لكم سعادة الدارين وان يزيدكم من فضله كما تدخلون السرور على قلوب طلاب العلم
    دائما تكثرون من العطاء وبكل سخاء دون كلل ولا ملل
    احسن الله اليكم كما تحسنون الى طلاب العلم دائما 
    -----
    اتفضل استاذى الجليل ومعلمى القدير ووالدى الحبيب 
    اولا الدالة الاتية لاحضار اسماء الحقول
     
    Function GetFieldNameFromRowSource(ComboRowSource As String, columnIndex As Integer) As String Dim columns As Variant Dim columnName As String ' Split the RowSource to get the column names columns = Split(Mid(ComboRowSource, InStr(ComboRowSource, "SELECT") + Len("SELECT")), ",") ' Extract the column name from the specified index columnName = Trim(Split(Split(columns(columnIndex - 1), "AS")(0), ".")(1)) ' Return the column name GetFieldNameFromRowSource = columnName End Function  وهذه الدالة التى يتم التحديث من خلالها
    Sub GetComboBoxNameAndUpdateTableRecords(frm As Form) Dim ctrl As Control Dim ComboRowSource As String Dim FldData As String Dim FldID As String Dim strSQL As String ' Loop through all controls on the form For Each ctrl In frm.Controls ' Check if the control is a TextBox or a ComboBox If TypeOf ctrl Is comboBox Then ' Perform your custom action for each control ' For example, print the name and set a default value If Not ctrl Is Nothing Then ' Debug.Print "Control Name: " & ctrl.Name ComboRowSource = ctrl.rowSource FldID = GetFieldNameFromRowSource(ComboRowSource, 1) FldData = GetFieldNameFromRowSource(ComboRowSource, 2) Dim varConditionFieldValue As Variant Dim varUpdateFieldValue As Variant ' Open the database Dim db As DAO.Database Set db = CurrentDb ' Verify RowSource If Len(ComboRowSource) = 0 Then ' Debug.Print "RowSource is empty for control " & ctrl.Name Exit For End If ' Open a recordset for the values in targetComboBox Dim rsCombo As DAO.Recordset Set rsCombo = db.OpenRecordset(ComboRowSource, dbOpenSnapshot) ' Verify Recordset If rsCombo.EOF Then ' Debug.Print "Recordset is empty for control " & ctrl.Name rsCombo.Close Set rsCombo = Nothing Set db = Nothing Exit For End If Do Until rsCombo.EOF Dim TableName As String Dim FieldToUpdate As String Dim ConditionFieldNameTable As Variant Dim ConditionComboBoxFieldNameTable As Variant ' Get the value from the current record in targetComboBox varConditionFieldValue = rsCombo.Fields(FldID).Value varUpdateFieldValue = rsCombo.Fields(FldData).Value ' Table and Field Names TableName = "Table1" FieldToUpdate = "textNm" ConditionFieldNameTable = "frmNm" ConditionComboBoxFieldNameTable = "FieldNm" ' Construct the SQL update statement strSQL = "UPDATE " & TableName & " " & _ "SET " & FieldToUpdate & "='" & Nz(varUpdateFieldValue, "") & "' " & _ "WHERE " & TableName & "." & ConditionComboBoxFieldNameTable & "= '" & ctrl.Name & "' AND " & _ TableName & "." & ConditionFieldNameTable & "= '" & Nz(frm.Name, "") & "' AND " & _ TableName & "." & FieldToUpdate & "= '" & varConditionFieldValue & "';" ' Debug.Print strSQL ' Execute the query db.Execute strSQL, dbFailOnError rsCombo.MoveNext Loop ' Close the recordset and the database rsCombo.Close Set rsCombo = Nothing Set db = Nothing End If End If Next ctrl End Sub ونستدعى الدالة فقط من خلال 
    GetComboBoxNameAndUpdateTableRecords Me هى سوف تقوم بكل شئ بالنيابة عنك  
    لا تقلق منها يا معلملى هى دالة ذكية ليست مثلى


    طبعا يا استاذى الجليل ومعلمى القدير و والدى الحبيب الاستاذ @ابوخليل 
    ان اردت اضافة هذه المعاملات (  parameters  ) الى رأس الدالة لتكتبها عند الاستدعاء ان كانت متغيرة فلا بأس بذلك سبق التعامل معها فى الامثلة السابقة
    ' Table and Field Names TableName = "Table1" FieldToUpdate = "textNm" ConditionFieldNameTable = "frmNm" ConditionComboBoxFieldNameTable = "FieldNm"  
    بــــــس خلاص أخيرا خلصت الواجب الحمد لله 
    واخيرا المرفق 

     
    DatabaseUp7.rar
  9. ابو جودي's post in اكثر الاصناف تم بيعه من حيث العدد والكمية was marked as the answer   
    اتفضل يا دكتور المرفق وبه 4 استعلامات
    تدلل واختر ما يلبى رغباتك
     
     
    الاكثر بيع.accdb
  10. ابو جودي's post in طريقة التحكم فى ليست بوكس بأكتر من زرار بناء على جدول يحتوى اسماء التحاليل والمجموعات التابعه لها was marked as the answer   
    بعد اذن اخوانى الكرام واساتذتى العظماء 
    اذا انا قدرت افهم اصح 
    هذه تجربتى بالمرفق  ده لو كنت فهمت صح يعنى
    ملحوظة انا حذفت جدول sub_tbl لان انا لا ارى له اى اثر ولا اى فائدة اصلا على الاقل طبقا للمرفق الاتى 
     
    اختنا الغالية @safaa salem5
    راجعت الاكواد قدر المستطاع وحسب ما ترائى لى قمت بسد كل الثغرات التى قد تضيف سجلات فارغة او ينتج عنها اخطاء باستخدام كود تصيد الاخطاء وذلك حسب الخطوات فقط التى كنت اقوم بتجربتها 
    اذا فى المرفق الفائدة اولا من تحقيق طلبك برجاء مراجعة الاكواد قمت بالعديد من الاضافات والتغييرات  
    كذلك باتت القاعدة لن تحفظ اى بيانات الا بالضغط على زر الامر حفظ 
     
    lab8.zip
  11. ابو جودي's post in طريقة استرجاع بيانات المريض بمجرد اختيار اسمه داخل فورم مصدره جدول واحد يحتوى تفاصيل الزياره وتفاصيل المريض was marked as the answer   
    ولا تزعلى نفسك سهله ان شاء الله
    اتفضلى يا افندم غيرى الكود السابق بالكود اللاحق
    Private Sub pname_AfterUpdate() If Not NewRecord Then Exit Sub Dim strDLookupFlds As String Dim stLinkCriteria As String Dim MyVariable As String Dim Arry() As String MyVariable = Me.pname stLinkCriteria = "[pname] ='" & MyVariable & "'" '|String On Error GoTo ErrorHandler strDLookupFlds = DLookup("[pname] & '|' & [code] & '|' & [ptitle] & '|' & [bdate] & '|' & [gender] & '|' & [phone] & '|' & [mobile] & '|' & [adress] & '|' & [email] & '|' & [wt] & '|' & [ht]", "[reservation_tbl]", stLinkCriteria) Arry = Split(strDLookupFlds, "|") Me.code = Arry(1) Me.ptitle = Arry(2) Me.bdate = Arry(3) Me.gender = Arry(4) Me.phone = Arry(5) Me.mobile = Arry(6) Me.adress = Arry(7) Me.email = Arry(8) Me.wt = Arry(9) Me.ht = Arry(10) ExitHandler: Exit Sub ErrorHandler: Select Case Err.Number Case Is = 94: pname.Requery: Resume ExitHandler Case Else MsgBox "Error Number : " & Err.Number & vbNewLine & "Error Description : " & Err.Description Resume ExitHandler End Select End Sub  
    وغيرى الكود الخاص بزر امر الاضافة الى الكود الاتى 
    Private Sub Add_cmd_Click() On Error GoTo Err_NewRec DoCmd.Requery DoCmd.GoToRecord , , acNewRec Exit_Err_NewRec: Exit Sub Err_NewRec: MsgBox Err.Description Resume Exit_Err_NewRec End Sub  
    وهذا مرفقكم بعد التعديل 
     
    lab3(2).zip
  12. ابو جودي's post in ماهو الخطا في حساب المجموع في تاريخ اليوم was marked as the answer   
    اتفضل  
     
    مم.accdb
  13. ابو جودي's post in ممكن طريقة اختيار ونقل ايتم من ليست بوكس ل ليست بوكس تانيه was marked as the answer   
    اتفضلى يا استاذة
    ان شاء الله يكون فى المرفق التالى كل طلباتك
     
     
    lab4.accdb
  14. ابو جودي's post in تحديث الشجرة تلقائيا was marked as the answer   
    اتفضل يا استاذ جو
     
    Familty_Tree Colors(3).accdb
  15. ابو جودي's post in بحث عن كود الصنف وان لم يجد تظهر رسالة بعدم الوجود was marked as the answer   
    طيب ايه رايكم فى كود صعنون وابن حلال 
    بعد تحديث مربع نص البحث X
    With Me.Recordset .FindFirst "catcods=" & Me.x If .NoMatch Then MsgBox "Not found" End If End With  
  16. ابو جودي's post in مساعدة فى عمل ترقيم تلقائى عند الاستخدام الاول لقاعدة البيانات تبعا لرغبات المستخدم بناء على قيمة من جدول اعدادات was marked as the answer   
    اتفضلى يا افندم انا اسف نسيت ارفق قاعدة البيانات
     
    New Microsoft Access Database.accdb
  17. ابو جودي's post in ترقيم تلقائي لنموذج بعد الفلترة was marked as the answer   
    اتفضل 
     
    test.accdb
  18. ابو جودي's post in ربط اكثر من نموذج فى نموذج رئيسى was marked as the answer   
    اتفضل يا استاذ @jo_2010
     
    AAA (2).accdb
  19. ابو جودي's post in تنسيق تقرير was marked as the answer   
    وبعد اذن استاذى الكريم @kkhalifa1960 
    هذا تعديل على المرفق 
     
    report (2).accdb
  20. ابو جودي's post in نقل بيانات من نموذج الى اخر was marked as the answer   
    طيب بعد اذن الاستاذ @Foksh 
    اتفضل يا استاذ @بونس الخطابي ان كنت قد استطعت فهمك
     
    عياده طبيب3.rar
  21. ابو جودي's post in عرض صورة من نوع .WEBP was marked as the answer   
    السؤال المهم انت عملت اعادة تسمية للامتداد ام قمت بتغيير الامتداد فعلا 
    لانك على اغلب الظن وبنسبة 100.01%  لم تقم بتغير الامتداد بل قمت باعادة تسمية الامتداد 
    افتح الصورة من خلال برنامج ال paint  ثم قم بعمل حفظ باسم واختر النوع JPG 
  22. ابو جودي's post in تغيير قيمة في جدول بناء علي قيمة في جدول اخر was marked as the answer   
    يا استاذ @abanob khairy 
    اتمنى اكون فهمتك صح 
    ومشاركة مع اساتذتى الافاضل الكرام  اتفضل جرب المرفق الاتى
    الحاق(2).accdb
  23. ابو جودي's post in جعل السكنر يقوم باخذ اكثر من صورة وتحويلها الى ملف pdf was marked as the answer   
    طيب تابه الموضوع الاتى 
     
  24. ابو جودي's post in اخفاء واظهر الحقول باستخدام If لا تعمل عند أختيار معين was marked as the answer   
    اتفضل يا سيدى ان شاء الله يكون ده طلبك 
     
     
    Database2 (3).accdb
  25. ابو جودي's post in تغيير تسمية ازرار المسج was marked as the answer   
    مش فاهم على فكرة
    ممكن توضيح ياريت لو ترفق صورة للمكشلة يكون افضل
×
×
  • اضف...

Important Information