I guess you have to assume the first time of the day is "In". So In, Out, In, Out, etc? Create new table tblHoursDiff with fields HoursDiffID(auto), UserId(numeric), TimeIn(datetime), TimeOut(datetime), HoursDiff (numeric). This is not tested, just throwing it out there.
Dim db as database, rs1, rs2 as Recordset, vUserID as Numeric, vIn as DateTime
Set db = CurrentDb
Set rs1 = db.OpenRecordset("Select * from tblAttendance Order By UserID, CheckTime")
Set rs2 = db.OpenRecordset("tblHoursDiff")
Do Until rs1.EOFIf vUserID = rs1!UserID
If Isnull(vIn) then
vIn = rs1!CheckTime
Else
rs2.AddNew
rs2!UserID = vUserID
rs2!TimeIn = vIn
rs2!TimeOut = rs1CheckTime
rs2!HoursDiff = DateDiff("h", vIn, rs1!CheckTime)
rs2.Update
vIn = null
End If
Else
vIn = rs1!CheckTime
Endif
vUserID = rs1!UserID
rs1.MoveNext
Loop