اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

المساعدة في جمع الدقائق حسب الشهر للموظف


الردود الموصى بها

السلام عليكم اساتذتي الافاضل ورحمة الله وبركاته

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

ولي طلب في هذا البرنامج وهو اريد جمع الدقائق في النموذج الفرعي حسب الشهر 

كمثال : - شهر التاسع ( مجموع الدقائق كذا ) 

             شهر الحادي عشر ( مجموع الدقائق كذا ) طبعا هذا في حقل مجموع الدقائق حسب الشهر مع فائق الشكر والاحترام

za-Time6.12-UP1.rar

رابط هذا التعليق
شارك

وعليكم السلام ورحمة الله وبركاته

 

تفضل :rol:

 

وهذا كود حدث الحالي للنموذج form1 ، والذي عليه قمت بعملية قراءة النموذج الفرعي:


Private Sub Form_Current()
On Error GoTo err_Form_Current

Me.aa1 = Nz(Int(Me![Text31] / 60), 0)
Me.gg = Nz(Int(Me![aa1] / 7), 0)


    Dim rst As DAO.Recordset
    Set rst = Me.frm2.Form.RecordsetClone
    rst.MoveLast: rst.MoveFirst
    RC = rst.RecordCount
    
    For i = 1 To RC
        If Len(rst!datee & "") <> 0 Then
        If Month(rst!datee) = 1 Then t1 = t1 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 2 Then t2 = t2 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 3 Then t3 = t3 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 4 Then t4 = t4 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 5 Then t5 = t5 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 6 Then t6 = t6 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 7 Then t7 = t7 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 8 Then t8 = t8 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 9 Then t9 = t9 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 10 Then t10 = t10 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 11 Then t11 = t11 + DateDiff("n", rst![hg1], rst![hg2])
        If Month(rst!datee) = 12 Then t12 = t12 + DateDiff("n", rst![hg1], rst![hg2])
        End If
        rst.MoveNext
    Next i
    
'
'   we get a write conflict when using this method!!
'    rst.MoveLast: rst.MoveFirst
'    For i = 1 To RC
'        If Len(rst!datee & "") <> 0 Then
'        rst.Edit
'        If Month(rst!datee) = 1 Then rst!DateSum = t1
'        If Month(rst!datee) = 2 Then rst!DateSum = t2
'        If Month(rst!datee) = 3 Then rst!DateSum = t3
'        If Month(rst!datee) = 4 Then rst!DateSum = t4
'        If Month(rst!datee) = 5 Then rst!DateSum = t5
'        If Month(rst!datee) = 6 Then rst!DateSum = t6
'        If Month(rst!datee) = 7 Then rst!DateSum = t7
'        If Month(rst!datee) = 8 Then rst!DateSum = t8
'        If Month(rst!datee) = 9 Then rst!DateSum = t9
'        If Month(rst!datee) = 10 Then rst!DateSum = t10
'        If Month(rst!datee) = 11 Then rst!DateSum = t11
'        If Month(rst!datee) = 12 Then rst!DateSum = t12
'        rst.Update
'        End If
'        rst.MoveNext
'    Next i
'

    Forms!form1!frm2.SetFocus
    Forms!form1!frm2.Form.GoToFirstRecord
    For i = 1 To RC
        If Len(Forms!form1!frm2!datee & "") <> 0 Then
        If Month(Forms!form1!frm2!datee) = 1 Then Forms!form1!frm2!DateSum = t1
        If Month(Forms!form1!frm2!datee) = 2 Then Forms!form1!frm2!DateSum = t2
        If Month(Forms!form1!frm2!datee) = 3 Then Forms!form1!frm2!DateSum = t3
        If Month(Forms!form1!frm2!datee) = 4 Then Forms!form1!frm2!DateSum = t4
        If Month(Forms!form1!frm2!datee) = 5 Then Forms!form1!frm2!DateSum = t5
        If Month(Forms!form1!frm2!datee) = 6 Then Forms!form1!frm2!DateSum = t6
        If Month(Forms!form1!frm2!datee) = 7 Then Forms!form1!frm2!DateSum = t7
        If Month(Forms!form1!frm2!datee) = 8 Then Forms!form1!frm2!DateSum = t8
        If Month(Forms!form1!frm2!datee) = 9 Then Forms!form1!frm2!DateSum = t9
        If Month(Forms!form1!frm2!datee) = 10 Then Forms!form1!frm2!DateSum = t10
        If Month(Forms!form1!frm2!datee) = 11 Then Forms!form1!frm2!DateSum = t11
        If Month(Forms!form1!frm2!datee) = 12 Then Forms!form1!frm2!DateSum = t12
        End If
        Forms!form1!frm2.Form.GoToNextRecord
    Next i
    Forms!form1!frm2.Form.GoToFirstRecord


    
Exit Sub
err_Form_Current:

    If Err.Number = 94 Then
        'null
        Resume Next
    ElseIf Err.Number = 3021 Then
        'No Records
        Exit Sub
    Else
        MsgBox Err.Number & vbCrLf & Err.Description
    End If
   
End Sub

 

وفي النموذج الفرعي ، نتحكم في التنقل بين السجلات:


Public Sub GoToFirstRecord()
    Me.datee.SetFocus
    'Go to the first record in the subform.
    DoCmd.GoToRecord , , acFirst

End Sub

Public Sub GoToNextRecord()
    Me.datee.SetFocus
    'Go to the next record in the subform.
    DoCmd.GoToRecord , , acNext

End Sub

Public Sub GoToLastRecord()
    Me.datee.SetFocus
    'Go to the last record in the subform.
    DoCmd.GoToRecord , , acLast

End Sub

 

 

جعفر

282.za-Time6.12-UP1.mdb.zip

  • Like 1
رابط هذا التعليق
شارك

السلام عليكم استاذ جعفر ورحمة الله وبركاته

نعم نعم نعم هذا هو المطلوب 

كلمة شكرا قليلة في حقك لكني ادعو لك بهذا الدعاء ( الله لايحرمنا من شخصك الكريم والطيب سائلا الله عز وعلا ان يمن عليك وعلى عائلتك الكريمة بالصحة والعافية والستر في الدنيا والاخرة يارب )

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information