merlynsdad
Programmer
I'm pulling logon and logoff times for employees. I have a loop that pulls the employee, then another loop inside that pulls all the logon and logoff times for that employee, record by record.There can be multiple signons/signoffs in a day. Where I'm running into trouble is that I need to accumulate all the logon and logoff times for each employee in a variable, store that somewhere, then clear the variable and go to the next employee. The code (so far) looks like this:
For each Employee in rst1
Do While Not rst1.EOF
With rst1
QryLoc = rst1![acd]
If event_type = 2 then
datSignon = time_stamp
ElseIf event_type = 3 then
datSignoff = time_stamp
ElseIf event_type = 4 then
datIdle = time_stamp
End if
datReadyTime = ((datSignoff - datSignon)-datIdle) '
Loop
datReadyTime = datReadyTimeStoredByEmployee
datReadyTime = ""
Next Employee
I'm not sure about the datReadyTimeStoredByEmployee at all, and am looking for a better way to do this. Suggestions, please?
If the square peg won't fit in the round hole, sand off the corners.
For each Employee in rst1
Do While Not rst1.EOF
With rst1
QryLoc = rst1![acd]
If event_type = 2 then
datSignon = time_stamp
ElseIf event_type = 3 then
datSignoff = time_stamp
ElseIf event_type = 4 then
datIdle = time_stamp
End if
datReadyTime = ((datSignoff - datSignon)-datIdle) '
Loop
datReadyTime = datReadyTimeStoredByEmployee
datReadyTime = ""
Next Employee
I'm not sure about the datReadyTimeStoredByEmployee at all, and am looking for a better way to do this. Suggestions, please?
If the square peg won't fit in the round hole, sand off the corners.