473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Time Clock/Punch Clock Database

9
Has anyone created a time clock Access database?

I'm referring to a database that will allow the user to sign-in at the beginning of the day then sign-out for lunch, sign back in then sign out at the end of the day. Then be able to total the number of hours worked. I also need to be able to track the time for those employees that do not sign in and out.

What I'm 'hoping' for is that someone has a sample database or reference they are willing to share so I can see how to set this up.

Thanks in advance for any help or suggestions.
Nov 13 '13 #1

✓ answered by Patrickwwevans

Here is how I have done this before. First make sure you have the code below to know the windows / AD id. Then set up your table where there is an userID column (varchar / text) then date / time column and then a Type column for either Start or End.. then you have a form on start up that on open, goes to a new record and all they have to do is click either a clock in button or clock out button. The vba code behind each will update the form with fosusername(), now() and either Start or End.

Then you can query to get the time diff and format for date to group by actual date and not time. Hope this makes sense. Should take all of an hour to create.

It is not a bad idea to also add code to lock down the db where they cannot get into the table in case you are worried about users "adjusting" their start / end times. You can prevent use of the shift key on open and also hid the ribbon to make it bullet proof.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
  3.     "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
  4.  
  5.     Function fOSUsername() As String
  6. Dim lngLen As Long, lngx As Long
  7. Dim strUserName As String
  8. strUserName = String$(254, 0)
  9. lngLen = 255
  10. lngx = apiGetUserName(strUserName, lngLen)
  11.  
  12.  
  13. If lngx <> 0 Then
  14.  
  15.     strUserName = Left$(strUserName, lngLen - 1)
  16.  
  17.     fOSUsername = (Trim(Right(strUserName, 255)))
  18.  
  19. Else
  20.  
  21.   fOSUsername = 0
  22.  
  23. End If
  24. End Function

4 16929
SDaxx
9
Thanks for the information it is a good starting point. However it does not have a timeclock feature for employees to clock in and out and that date and time of that action to be captured in a table. Any help would be appreciated.

SDAXX
Nov 15 '13 #3
Here is how I have done this before. First make sure you have the code below to know the windows / AD id. Then set up your table where there is an userID column (varchar / text) then date / time column and then a Type column for either Start or End.. then you have a form on start up that on open, goes to a new record and all they have to do is click either a clock in button or clock out button. The vba code behind each will update the form with fosusername(), now() and either Start or End.

Then you can query to get the time diff and format for date to group by actual date and not time. Hope this makes sense. Should take all of an hour to create.

It is not a bad idea to also add code to lock down the db where they cannot get into the table in case you are worried about users "adjusting" their start / end times. You can prevent use of the shift key on open and also hid the ribbon to make it bullet proof.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
  3.     "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
  4.  
  5.     Function fOSUsername() As String
  6. Dim lngLen As Long, lngx As Long
  7. Dim strUserName As String
  8. strUserName = String$(254, 0)
  9. lngLen = 255
  10. lngx = apiGetUserName(strUserName, lngLen)
  11.  
  12.  
  13. If lngx <> 0 Then
  14.  
  15.     strUserName = Left$(strUserName, lngLen - 1)
  16.  
  17.     fOSUsername = (Trim(Right(strUserName, 255)))
  18.  
  19. Else
  20.  
  21.   fOSUsername = 0
  22.  
  23. End If
  24. End Function
Nov 15 '13 #4
SDaxx
9
Thank You! It worked great.

SDAXX
Nov 15 '13 #5

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

Similar topics

1
by: Juan Manuel Alegría B. | last post by:
Hi group!! I've been making an application in which I need to know if a user changed the time of the system clock. Is there a log where is registered that information or any API to consult? ...
12
by: hallpa1 | last post by:
Hi all, I posted messages before about trying to purge many records (about 35%) of a 200Gig database. The responses gave me a lot to think about, especially regarding the indexes. But due to the...
0
by: antonyliu2002 | last post by:
I am having a hard time connecting to an oracle database from within Visual Web Developer (VWD) 2005 Express Edition. Check out the screen snap shot here: ...
5
by: netapawar | last post by:
hey can u tell me, how can i insert records in two tables at a time in MS access database. hey plz help me...................................
1
by: syed_razi | last post by:
I have a VB 6.0 application using Access as backend. It is being used on a local area network. The backend database is password protected. The problem is that the database gives me a run time...
4
by: nastay1028 | last post by:
Please help me out all you code junkies on here. Im in a web design course and im trying to get a piece of javascript that will allow me to change the time that it want it to start from. Kind of...
9
by: Ron Adam | last post by:
I'm having some cross platform issues with timing loops. It seems time.time is better for some computers/platforms and time.clock others, but it's not always clear which, so I came up with the...
6
by: MISASIA | last post by:
I really hope someone can help me... My office is using a Menu which running VB. There got many button in that Menu and one of the button which name as "GMR" hit error. Its prompt a message box...
2
by: mamunur rashid | last post by:
I am using following function and I want time in 24hr clock format but this gives me time in 12hrs: <?php date_default_timezone_set('Etc/GMT+6'); $timestamp = date("Y-m-d H:i:s", time());...
1
by: Rekha Angappan | last post by:
I have to insert a date/time field in access database from my java code. But the date/time field format in DB is MM/DD/YYYY HH/MM/SS AM/PM.I tried the code below. DateTime date=new DateTime(); ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.