08-08-18, 06:59 PM
أهلا أخي الكريم , أعتقد الأن وضحت الفكرة , إذا السبب الذي أدى للمشكلة هو وضع حقل ECase في شرط جملة الإستعلام لذلك إن شاء الله بإزالته تنحل المشكلة , فسيكون كود الإجراء بعد التغيير هكذا :
PHP كود :
Public Sub CountEM()
If RSGhiab.State = adStateOpen Then RSGhiab.Close
RSGhiab.Open "SELECT * FROM falowTB where FDate=#" & Format(Date, "mm/dd/yyyy") & "#", Db, adOpenStatic, adLockPessimistic
If RSGhiab.RecordCount > 0 Then
If RSGhiab.State = adStateOpen Then RSGhiab.Close
MsgBox "لقد تمت التهيئة مسبقاً"
Exit Sub
Else
If RSCountEM.State = adStateOpen Then RSCountEM.Close
RSCountEM.Open "SELECT EmID FROM EmpTB", Db, adOpenStatic, adLockPessimistic
If RSCountEM.RecordCount > 0 Then
RSCountEM.MoveFirst
Do While Not RSCountEM.EOF
RSGhiab.AddNew
RSGhiab![FEmpID] = RSCountEM![EmID]
RSGhiab![FDate] = Format(Date, "mm/dd/yyyy")
RSGhiab![Ftime] = Format(Time, "HH:MM:SS AM/PM")
RSGhiab![Fday] = Format(Date, "dddd")
RSGhiab![EReson] = ""
RSGhiab![ECase] = 0
RSGhiab![ECovr] = 0
RSGhiab![Enots] = ""
RSGhiab.Update
DoEvents
RSCountEM.MoveNext
Loop
MsgBox "تمت التهيئة"
Else
MsgBox "لم تتم التهيئة, لم يتم العثور على موظفين مسجلين!"
End If
If RSGhiab.State = adStateOpen Then RSGhiab.Close
If RSCountEM.State = adStateOpen Then RSCountEM.Close
End If
End Sub
كود :
For Each Breathe in MyLife
Breathe.Say " سبحان الله والحمد لله ولا إله إلا الله والله أكبر أستغر الله العظيم وأتوب إليه"
Next
