By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Time Clock

P: 1
I work in Human resources and my company has very limited resources. I am trying to put together a database that will allow my employees to clock in and out on. I am a novice Access user so this has been a little difficult. What I would like to happen, is to have a button to clock in, clock out, break in/out and lunch. When the button is clicked I would like to have the text box below the button display the date and time and time. Any advise besides just going out and purchasing a program?
Jan 28 '12 #1
Share this Question
Share on Google+
3 Replies


Seth Schrock
Expert 2.5K+
P: 2,941
Have you done anything with Access for this program or do you have a blank slate? How much time do you have to get a database up and running before you have to purchase a new system?
Jan 28 '12 #2

Expert 100+
P: 446
Hi,
As you say that you are a novice in Access I'm going to attach a Microsoft example of a Time and Billing system to give you some idea of what might be achieved. In it's original form it did not the data logging that you require but I have started to extend it.

This system accumulates hours to specic tasks and calculates charges to be billed back to the project. Each project is identified to a customer. It also accumulates other expenses in addition to labour charges. So it is probably doing much more than you currently require.

The naming of tables, forms, queries and reports seems to be aimed at giving clarity to their function rather than the more generally adopted convention of prefixing each with tbl, frm, qry and rpt; and removing spaces.

One neat trick, that is used to copy the Billing Rate from an Employee to a task, is to use a hidden column in the combo box (see if you can find it!) This is easy in access but I've never managed it in VB.

To extend this application to your requirement you will need to capture two extra fields (called say StartTime and FinishTime) I think you have two options. The first would be just to add them to the table [Time Card Hours]. The existing field [Billable Hours] would then have to be calculated.

(Time passes. . . while I check viability )

OK, I've just tested out these thoughts and they are now incorporated in the attached application. When it opens click on the Time Cards button and then add an entry. Double click on StartTime and the current time will be entered. Let time pass then double click on EndTime. The new current time will be entered then the BillingHours will be calculated. I've added code to round the times to nearest quarter hour, to avoid silly decimals (Write your own). The added code is something like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub StartTime_DblClick(Cancel As Integer)
  2. Me.StartTime = Now()
  3. End Sub
  4.  
  5. Private Sub EndTime_DblClick(Cancel As Integer)
  6.  
  7. If IsNull(Me.StartTime) Then
  8.     MsgBox "Please enter a Start Time", vbCritical, "No Start Time"
  9.     Me.StartTime.SetFocus
  10.     Exit Sub
  11. End If
  12.  
  13. Me.EndTime = Now()
  14. checkHours
  15. End Sub
  16.  
  17. Private Sub checkHours()
  18.  
  19. Dim WholeHours As Integer
  20. Dim WholeMinutes As Integer
  21. Dim DeciHours As Single
  22.  
  23. WholeHours = DateDiff("h", Me.StartTime, Me.EndTime)
  24. WholeMinutes = DateDiff("n", Me.StartTime, Me.EndTime) Mod 60
  25.  
  26. If WholeMinutes < 15 Then
  27.     DeciHours = 0
  28. ElseIf WholeMinutes >= 15 Then
  29.     DeciHours = 0.25
  30. ElseIf WholeMinutes >= 30 Then
  31.     DeciHours = 0.5
  32. ElseIf WholeMinutes >= 45 Then
  33.     DeciHours = 0.75
  34. ElseIf WholeMinutes > 55 Then
  35.     DeciHours = 1#
  36. End If
  37.  
  38. Me.BillableHours = WholeHours + DeciHours
  39.  
  40. End Sub
This is just a demo to give you some ideas. I don't think you can see the time card for a person for a particular week.

All users can see everything. This is OK if a clerk is entering the data but may need revising so general users only see their own time card. I would certainly consider a simplified input-form.

When I first looked at this I was considering adding a new table to hold the Start and End times (option 2 above), then rolling-up the bookings for a single day per Employee. But at the moment I cannot see many advantages in complicating the matter and wait for some initial feed-back
S7
Attached Files
File Type: zip Time_billing.zip (203.0 KB, 307 views)
Jan 29 '12 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
Is this to be run from a single PC standing at the entrance? From multiple PC's standing at multiple entrances? Or from each users individual PC?
Jan 30 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.