Re: ClockCard application design

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Many thanks for your advice. I have gone with the two table approach and
I'm currently writing the code for the application. The user will swipe
in/out with a clockcard. The code inserts a [TimeIn] into tblWorkPeriod if
the Employee hasn't already clocked in or the employee has already clocked
in and out earlier that day. My problem is sometimes employees work nights
and start at 10pm and finish at 6am. In my current code below the employee
would clock in at 10pm one day but when they went to clock out at 6am, this
would create another ClockIn as they day had changed. Anyway around this?


If DCount("*", "tblWorkPeriod", "[WorkDate] = #" & Date & "# And [EmpID] = "
& lngEmpId) > 0 Then
' User has already clocked in today
strSqlSel = "SELECT * FROM tblWorkPeriod WHERE [WorkDate] = #" &
Date & "# And [EmpID] = " & lngEmpId
Set rs = db.OpenRecordset(strSqlSel)
rs.MoveLast
If IsNull(rs!TimeOut) Then
TimeOut lngEmpId
Else
' User has clocked in and out already today
TimeIn lngEmpId
End If
Else
' Employee clocks in for first time
TimeIn lngEmpId
End If


.



Relevant Pages

  • Re: Principle of Orthogonal Design
    ... EMPLOYEE relation with two keys, Badge# and SSN. ... Note that in the PAYROLL relation, there is a tuple for each ... for each workday even if there isn't one in the CLOCK relation. ...
    (comp.databases.theory)
  • Re: Principle of Orthogonal Design
    ... EMPLOYEE relation with two keys, Badge# and SSN. ... Note that in the PAYROLL relation, there is a tuple for each ... for each workday even if there isn't one in the CLOCK relation. ...
    (comp.databases.theory)
  • Re: Principle of Orthogonal Design
    ... EMPLOYEE relation with two keys, Badge# and SSN. ... for each workday even if there isn't one in the CLOCK relation. ...
    (comp.databases.theory)
  • Re: Problem with my time clock database
    ... if all employees clock in and out on the same day, ... TimeIN ... If the employee pushes the button ... again it will fill in the TimeOUT field. ...
    (comp.databases.ms-access)
  • Re: Principle of Orthogonal Design
    ... EMPLOYEE relation with two keys, Badge# and SSN. ... for each workday even if there isn't one in the CLOCK relation. ...
    (comp.databases.theory)