+ Reply to Thread
Results 1 to 75 of 75

Need help with Punch in and Punch out clock system please.

  1. #1
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Need help with Punch in and Punch out clock system please.

    Good day all

    I don't know if there is already a post like this, but I was wondering if anybody will be willing to assist me.

    The company I work for uses a payroll program, but all the employees days, working hours, and overtime hours had to be input by means of manual job costing input. I have now recently changed it a bit, so I can do all the work in excel, and then just import it into the payroll program. This made the process go quicker, but I want to streamline it more.

    I was wondering if it is possible for the employees to "clock in" by means of a bar-code, and the person's employee number, name and obviously date and time be posted to a sheet, and when they "clock out" it should record the "clock out" time in the next cell to the right of the "clock in" time. My aim is to record the times in and out, then calculate the difference in time per day, and then by means of vlookup to record the hours worked per person per day for the bi-weekly period to another sheet.

    I have researched numerous videos, and posts, but cannot find a way to do this (that is how I came upon this forum.

    Needless to say... i have hit a wall, and it feels like I have reached the limit of my knowledge.

    The picture attached is a sample of how I would like to use the "clock in / out" page, by means of a form.

    If anybody could assist me with this, it would be greatly appreciated.

    Thank you in advance for any input.

    Regards
    Attached Images Attached Images

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi, welcome to the forum.
    First, I am assuming that there is no punch clock on the premises, if there was maybe this registered somewhere, but I guess that you already went down that road.
    This file you have created, is it EXCEL and is it on a network drive / share or local?
    If the user logs on to his/her system you could also write a single line of text to a text or csv file telling you the username, the date and time spent , the same when he she logs out of the system.
    These triggers can be initiated using the windows scheduler and if done correctly the network engineer could program it remotely.
    It all depends how you want to collect the data and what you want EXCEl (it it's in Excel) to do with the data.
    Hope to hear from you (if I didn't scare you off with all the questions )
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Hi, welcome to the forum.
    First, I am assuming that there is no punch clock on the premises, if there was maybe this registered somewhere, but I guess that you already went down that road.
    This file you have created, is it EXCEL and is it on a network drive / share or local?
    If the user logs on to his/her system you could also write a single line of text to a text or csv file telling you the username, the date and time spent , the same when he she logs out of the system.
    These triggers can be initiated using the windows scheduler and if done correctly the network engineer could program it remotely.
    It all depends how you want to collect the data and what you want EXCEl (it it's in Excel) to do with the data.
    Hope to hear from you (if I didn't scare you off with all the questions )
    Thank you for your response.
    1. You are correct. There is no punch clock on the premises.
    2. The file is created in Excel with plenty of macros, and my idea is for it to be at a fixed pc, where people will clock in and out every day. The idea is to have it in a "Dropbox type file" where I can access it from my computer when need be.
    3. The people are all labourers, and dont work on computers, so I could not use log in times on their computers.

    Basically, I want to record the data in a sheet in Excel (lets say punchin sheet), and then have another sheet within the same file (lets say timesheet) which will then use a lookup function to get the data from "punchin" to display the working hours per day in the "timesheet" sheet.

    My problem is that I need to find a way for the labourer/person to "clock" in and out by means of code, or scanner. When the persons identity card is scanned by barcode scanner (or pin number entered), I want excel to write the persons pay number, name & surname, and time punched in to the "punchin" sheet, and when they punch out/clock out for lunch, then excel must write a timestamp in the same line as the persons time-in on the "punchin" sheet. Then when the person returns from lunch and clock's in again, it must again write the persons pay number, name & surname, and time punched in to the "punchin" sheet, and when the person leaves for home, and clock-out, then it must again write the timestamp behind the time the person clocked in after lunch.

    I hope this makes more sense of what I am trying to do. And I would like to than you again for your assistance.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    There are barcode scanners and software to do just that.
    You scan a barcode, in this case the person's identity card or company card and then just press an IN or OUT button and go.
    The other way is the user to click his / her name on a list, enter a password which they may choose the first time so that nobody logs on another user's name.
    Do you have a copy of the file with the punchcard you can share? Add two or three ficticious names and I'll see what I can do for you as goes the Excel part.

  5. #5
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    There are barcode scanners and software to do just that.
    You scan a barcode, in this case the person's identity card or company card and then just press an IN or OUT button and go.
    The other way is the user to click his / her name on a list, enter a password which they may choose the first time so that nobody logs on another user's name.
    Do you have a copy of the file with the punchcard you can share? Add two or three ficticious names and I'll see what I can do for you as goes the Excel part.
    Thank you again for your assitance.

    The file attached named sample.xlsm is the current file i am using to record the persons days worked. The file called "sample punch clock.xlsm" I received from someone else. The log in system pretty much works the way i want it, but it only records 1 clock in time and 1 clock out time per day, and after the week is finished, it finalizes the sheet, and renames it. I want to incorporate his clock in system with my program, but I want to keep all the records in 1 sheet, and then let excel pull over the information via vlookup, or something.

    Unfortunately I had to zip the sample file, because it was too big to upload as xlsm file.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294
    Hi,

    This is actually a pretty simple approach. How to implement a barcode hardware system is not my forte. But you could adapt your code in the future for it.

    I would recommend...

    Write a userform for a login. User logs in with pass and username. User clicks button to either clock in or out. Every time the clock in button is pressed, you stamp the time and date to a "database" sheet. To avoid confusion and allow analyzing the data easy, you could write the status to a column adjacent to the timestamp. Which has the condition either "clock in" or "clock out".

    Pull this "database" spreadsheet from a main reporting macro sheet and analyze it to your hearts content.

    Where do you store the passwords? You can hardcode them in the login macro. But they won't be dynamic so adding a user or altering a password will be a bit tedious. You could include login credentials for each user in the database file and when the user goes to log in, you query their name and find the pass. If it matches, waalaa.


    I've attached a really down and dirty userform example. Not near to the extent i describe above. But all you really need to do in simple terms is input data to a "database".
    Attached Files Attached Files
    Last edited by ironfelix717; 08-15-2018 at 11:26 PM.

  7. #7
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by ironfelix717 View Post
    Hi,

    This is actually a pretty simple approach. How to implement a barcode hardware system is not my forte. But you could adapt your code in the future for it.

    I would recommend...

    Write a userform for a login. User logs in with pass and username. User clicks button to either clock in or out. Every time the clock in button is pressed, you stamp the time and date to a "database" sheet. To avoid confusion and allow analyzing the data easy, you could write the status to a column adjacent to the timestamp. Which has the condition either "clock in" or "clock out".

    Pull this "database" spreadsheet from a main reporting macro sheet and analyze it to your hearts content.

    Where do you store the passwords? You can hardcode them in the login macro. But they won't be dynamic so adding a user or altering a password will be a bit tedious. You could include login credentials for each user in the database file and when the user goes to log in, you query their name and find the pass. If it matches, waalaa.


    I've attached a really down and dirty userform example. Not near to the extent i describe above. But all you really need to do in simple terms is input data to a "database".
    Thank you for your input.

    The barcode part of it I kinda got sorted. I am using a barcode font, and when I scan the barcode it works in the above userform.

    The way your sheet works, is pretty much what I want to happen, BUT I would like the clock out/punch out time to be in the same line/row as the clock in time. That way I can calculate the time worked. The reason I have to calculate it like that, is because when they go on lunch, that time has to be deducted (as lunch time is not paid time). And if they work after 18h00, they get a different tariff, and it will be easier to calculate if it is in the same line/row. So on average every person should have 2 clock in and 2 clock out times per day. Then I can use the sumif and/or vlookup function in a different tab to obtain the actual working hours per day, and pay the person according to that.

    The passwords are stored in a separate "database" sheet within the excel file. If you look at the "sample punch clock.xlsm" file I posted, the passwords are in column X under the "Employee Record" tab. They are in white, but it's the same as the employee ID.

    Thank you again for your help end effort guys.

  8. #8
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Need help with Punch in and Punch out clock system please.

    Hi,

    The way the example is written, the file userform writes the clock in in a single column, like you explained. You could go a step further and have it write the times by user in a single user column, but I wouldn't recommend that, as you can do that in analysis pretty easy with some index formulas. Some things to keep in mind: Excel isn't extremely secure, you can do enough to prevent the average joe from finding password, but if you have any tech experience guys that might be interested in hacking the sheet, do some thinking on that. I would also structure the data by type (clock in, clock out, lunch in, lunch return). This will make your analysis easier, in my opinion. The next thing I would do is in the userform, Say Joe is clocked in already, if he goes to log in again, his button will ONLY say "Clock out". This helps provide some feedback to the user. Say he forgot to clock out the night before and comes to work in the morning and clocks in, but it says "clock out", he can go to his supervisor and explain he forgot to ever clock out.

    The last thing is, you might consider separating your userform sheet, and your database sheet as seperate workbooks or as a legitimate database. Reason for doing this would be added security and also multi-user access. You can access a closed workbook with Excel's built in library ADODB or an MS Access database. Greater learning curve but increased benefits.



    Just some thoughts!
    Last edited by ironfelix717; 08-16-2018 at 09:31 PM.

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I agree with @ironfelix717, security as come to passwords in Excel is okay but insufficient, even though I think that that is not the issue right now.
    The point about the check if the user is still clocked in is a good one, but if you have 24/7 shifts that go across midnight the employee will only have Clock OUT at the beginning of the day.
    The lunch issue is simple, I have used it quite often. In a named range you set the time allowed for a lunch break, dinner or maybe even breakfast
    When calculating you check that if the time between clock in and clock out spans midday (or normal lunch start) you subtract that from the total time.
    Back to the password issue, the password entered is for the userform so anyone can clock another employee in or out. Not a good idea.
    Finally the MS Access Database will give extra security

  10. #10
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Im not too concerned about the passwords at this moment, because the people that clock in or out will only see the login form. The sheet with the passwords will be hidden, and only the administrator will have access to that. The person will in fact not even know what the password is, because it will be disguised as a barcode font. So they don't have to physically press any buttons, they just have to scan the barcode on their ID card. That part I have figured out already.

    I actually would like to implement the check if the user is still clocked in. But I have hit a wall guys. Like a mental block.

    Firstly I don't know the code needed to write the info from the login screen to the sheet

    Secondly I don't know the code to tell the program to check if the person is clocked in, and if he/she is clocked in, how to write the clock out time in the same line, and append the clock in and clock out time so it is written in the same line in the time sheet. The lunch issue I can work out after that.

    I appreciate your help.

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I'll take a look and see what I can do for you, I'm sure ironfelix717 will come up with something

  12. #12
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Thank you.... I really appreciate it.

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Just to make sure I've got it right, the identifier is the Employee ID column W in the Employee Record worksheet?

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Just to let you know I started a little. The attached file is just a teaser.
    I've left all worksheets visible and the Main_Sheet is the one to work with.
    Before you edit the VBA code stop the timer, this will then not interfere.
    The timer is triggered on opening and will unschedule on closure to avoid issues.

    I started on the code checking the max in and max out
    The code will permit to clock in a person once and that's it.
    All it does is add a record in the LOG sheet with the emp id, name clockin and clockout (not implemented yet) clock out and the column next to it calculates the total time between if both are filled.

    I wa even thinking that all you need is this file with the log sheet, but not the employee records to look them up.
    You could read the employee file on-the-fly (open it read only) to verify emp id and name and then close it again.
    So then all you need is export the log sheet when you want to create the lists or whatever you do with it.
    Right now you have to enter the employee id by hand but as you mentioned that the barcode reader can enter that field for you then you don't need anything else than just open the form, click in or out and it's done.
    The user shouldn't need to enter the time, the clock does this, so that files is only necessary to show that the emp is clocked in when clocking out?

    Off to bed now. Cheers
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Just to make sure I've got it right, the identifier is the Employee ID column W in the Employee Record worksheet?
    Good morning. Thats is correct yes

  16. #16
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Just to let you know I started a little. The attached file is just a teaser.
    I've left all worksheets visible and the Main_Sheet is the one to work with.
    Before you edit the VBA code stop the timer, this will then not interfere.
    The timer is triggered on opening and will unschedule on closure to avoid issues.

    I started on the code checking the max in and max out
    The code will permit to clock in a person once and that's it.
    All it does is add a record in the LOG sheet with the emp id, name clockin and clockout (not implemented yet) clock out and the column next to it calculates the total time between if both are filled.

    I wa even thinking that all you need is this file with the log sheet, but not the employee records to look them up.
    You could read the employee file on-the-fly (open it read only) to verify emp id and name and then close it again.
    So then all you need is export the log sheet when you want to create the lists or whatever you do with it.
    Right now you have to enter the employee id by hand but as you mentioned that the barcode reader can enter that field for you then you don't need anything else than just open the form, click in or out and it's done.
    The user shouldn't need to enter the time, the clock does this, so that files is only necessary to show that the emp is clocked in when clocking out?

    Off to bed now. Cheers
    Good morning people.

    Keebellah
    I have looked at the example. The format of the employee log is exactly what I want. ClockIN, ClockOUT and then the difference between the 2. Then the person can clockIN again on the same day, and clockOUt again, and then I can use the SUMIF and VLOOKUP formulas to get the information I need in another sheet.

    You are correct in saying that the employee must not enter the time, because that could then be altered, and thats no good. They must just scan the barcode, and the program should automatically clock them IN or OUT depending on the status.

    Thank you for your effort thus far. I really appreciate it.

  17. #17
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I did some more than I wanted.
    I have attached the file and a PDF file explaining principles of the file and how to start working with it.
    You can build on from there as goes reporting and more.
    One this you should avoid is repetitive code like Eugene helped you with, put it all in one routine so you don't have to change it a large number of places when a new filed is added or renamed. Use Constants to address worksheets, if you change the name of a worksheet you only have to do it in one place.
    Hope I didn't overkill it but I think you can build on with it.
    Fine-tuning is the next step
    Happy coding
    Attached Files Attached Files

  18. #18
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hope I haven't scared you off
    Minor correction, force configuration settings if settings are incorrect
    Also added double-click options to the (hidden) ADMIN_SHEET
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Wow Keebellah.... WOW WOW WOW WOW WOW!!!!!

    Thank you so very much. This is WAAAAAAY more than I asked for.

    Going to start testing it today still.

    Thank you again from the bottom of my heart!

  20. #20
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    It is also possible to have the log file 'outside' the main file so that you can always access it (read only) for reporting and checking if all logs are correct.
    Minor modifications such as destination folder (where you want the logfile) is easily added.
    I would go for that option so that the App can always remain open for Clocking IN / OUT and automatically create a new log file if the month changes

  21. #21
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    It is also possible to have the log file 'outside' the main file so that you can always access it (read only) for reporting and checking if all logs are correct.
    Minor modifications such as destination folder (where you want the logfile) is easily added.
    I would go for that option so that the App can always remain open for Clocking IN / OUT and automatically create a new log file if the month changes
    That sounds like a great idea, but would it not interfere if the separate log file is open? For instance is someone is working in it?

    Then again... if the data is being pulled in automatically, then the log file would not be seen as open. Am I correct in my assumption?

  22. #22
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    The idea behind this is that if the log file is accessed it be accessed from let's say the 'reporting and maintenance' tool you have elsewhere that will just read the contents into a temporary worksheet to analyze.
    So it opens the log read-only and closes it immediately leaving it available at all times.
    The maintenance part can also be used to check the employees that did not log out earlier dates in the month or previous months and to correct this, in this case, just like the punch-clock tool, it opens the log, registers the time and closes it again.
    I hope my explanation makes sense.
    It will require you to write some code that you can have in another file that will be used for maintenance and reporting, e.g. it can even be the Employee record file since the punch-clock only accesses it read-only

  23. #23
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    I just picked up a hickup.

    I clocked 2 persons in, then waited a couple of minutes, and clocked them out. no problem. Then I clocked them back in again, also... no problem. Now, when I want to clock them back out again, it only shows the clock in button again. It would not let me clock them out again. Any thoughts?

  24. #24
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Should be, am not at my PC now, will check it and get back to you

  25. #25
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Found it (I hope)

    Replace this section of code in PunchClockForm with the code below

    That should do it.

    Please Login or Register  to view this content.

  26. #26
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Hi Keebellah

    For some odd reason mine does not want to work when I post the code. I mean there is no error messages, but it still would not allow the check out button to show when I want to clock out the people.

    I have attached my files thus far. I added a date column to the employee log tab, and I also added a employee data sheet (EMPDATFIL.xlsx), and then made some minor changes to the timesheet to pull the time worked over.
    Attached Files Attached Files

  27. #27
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Okay, I'll look at your files and see what's wrong.
    In the meantime I implemented the 'external' log file.
    You will have to indicate the folder where you want the log file to be placed.
    A new log file will be created automatically on the first day of each new month upon the first action with the file
    The logs filename will be YYYY-MM-Monthname ful-out.xlsx
    No provisions made yet if the works night shift and he logged in the last day of the month and wants to log out the first day of the new month.
    The new log file is a copy of the hidden EMPLOYEE_LOG file, so if you add columns there these will be copied too.
    Attached Files Attached Files

  28. #28
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Yep, something wrong with the code, will have to sit down for it.
    Get back to you later this evening.

  29. #29
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I reviewed the code and made more changes.
    V1.1 is now working as it should, I made quite some modifications which I will need to explain later to explain my train of thought and why I did it.
    I got the CI and CO working as it should, the employee clock log folder is now also required and a new log file is created at the change of every month.
    I've attached a zip file with the last version of the application, the log folder with one log showing the tested employees and the folder with all the vba code extracted.

    I also attached a zip file with the used images
    Good-night for now.
    Cheers
    Attached Files Attached Files

  30. #30
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    You sir, are a magician. WOW... Truly remarkable work!

    Thank you very very very much!

  31. #31
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    No magic, just VBA fun

  32. #32
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Just for your information.
    The only time the Employee log file is not read-only is the short span of time that it takes to write the new record.
    So if you access the file as read-only (this is important) for reporting purposes there is no hitch when it comes to the punch-clock application accessing this same file. If you do not do this the record cannot be written and an error is raised and I did not take this into account when coding the module.

  33. #33
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Just for your information.
    The only time the Employee log file is not read-only is the short span of time that it takes to write the new record.
    So if you access the file as read-only (this is important) for reporting purposes there is no hitch when it comes to the punch-clock application accessing this same file. If you do not do this the record cannot be written and an error is raised and I did not take this into account when coding the module.
    Hi Keebellah

    Thank you, that is good to know.

    Firstly.... thank you once again for all your help and assistance. It is greatly appreciated. You solved a problem I have been sitting with for weeks. Thank you.

    Secondly... I wonder if you could help me with 1 mall change. On the screen where the person clocks in/out (PunchClockForm), I changed the order of the TabIndex. I want to make it so that when the password is entered, it outomatically jumps to the CheckIn or CheckOut tab/button, but it has no effect after I changed it. Instead of going to the CheckIn/CheckOut button, it goes to the ClearEntry button. Any ideas about what I am doing wrong, or is a line of code that needs to be inserted?

    Thank you again for this magnificent project.

    Regards

  34. #34
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    There are two methods, you set the tab order (under view) and the other way is that focus is set using the vba code.
    The way it works now is that after you enter the ID (password) the focus is either set to the CI button or CO button depending on the result.
    So when it's a new ClockIn the focus is set to button to register the Check IN, the other the focus is set to the Check OUT
    When you do not enter anything an just press Tab the next stop is the CI confirm button, but because it's disabled it tries the next one which is the CO confirm button, but this one is disabled too so the next is the Clear Entry.
    I hope this explains it

  35. #35
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    There are two methods, you set the tab order (under view) and the other way is that focus is set using the vba code.
    The way it works now is that after you enter the ID (password) the focus is either set to the CI button or CO button depending on the result.
    So when it's a new ClockIn the focus is set to button to register the Check IN, the other the focus is set to the Check OUT
    When you do not enter anything an just press Tab the next stop is the CI confirm button, but because it's disabled it tries the next one which is the CO confirm button, but this one is disabled too so the next is the Clear Entry.
    I hope this explains it
    That is how I understand it, but it does not follow that route. When I enter a password, it automatically goes to Clear Entry. It's almost like the Check In and Out buttons are not there

  36. #36
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I'll check and see what can be the reason

  37. #37
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Thank you sir

  38. #38
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I checked and tried all, but there is no option.In my case it goes to the Close button.
    Sorry for that, tried everything I know.

  39. #39
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    I checked and tried all, but there is no option.In my case it goes to the Close button.
    Sorry for that, tried everything I know.
    Thank you for your effort, I really appreciate it.

    Will fiddle around with it some more. Maybe I will get one of those light bulb moments when I least expect it

  40. #40
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I think it's the fact that all the other lables are not enabled, when entering the employee id you either strike enter or press the TAB key; it then checks if the employee id is valid and looks up the name from the employee file. Even if the button that corresponds to the next action is enabled, the focus goes to the first tab stop after that and that is the Close button, to avoid this the action to check should not be triggered when the password filed is exited but a button next to it be pressed to verify the ID, that will require an extra action by the user.
    So the idea (you can try it on the code) is add an extra button next to the employee id field that gets the focus when the user presses TAB key er strikes Enter and if the emp ID is not empty, and this button then does the check. I think that would do the trick, (place the code now in the Password_Exit in the code for the newbutton_click action and delete the password_exit routine

  41. #41
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    It was a little more that that
    try this
    Attached Files Attached Files

  42. #42
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Apologies for only coming back to you now. I was out of office whole day.

    I looked at the modification, and it works well. Thank you again sir.

  43. #43
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    No problem, and glad it works.
    I shared the file with another poster, added an additional requirement.

  44. #44
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Hi guys

    Just an update... I've been testing the system, and it works quite well.

    I have attached a copy of how it works, and the files used. I have added quite a lot of formulas in my own sheet as
    well (to lookup and add the times for specific days, work out overtime, and and and)

    Last final obstacle I have come across, is that a when the person clocks in/out, enter(carriage return) needs to be
    pressed 3 times (when password is entered, on second box, then on clock in/out button). Is there perhaps a piece
    of code that can be added for the program to do that automatically?

    Thank you again for all your help. You made this possible.
    Attached Files Attached Files

  45. #45
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi, I started on a variation of my own for a different purpose, will update it when really completed.
    I'll unpack the zipped file and see if I can spot it and see if I can come up with a solution for you.
    Will let you know asap

  46. #46
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    In the PunchClockForm, modify this macro as follows:

    Please Login or Register  to view this content.

  47. #47
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Additionally you can edit the tab order in the userform and also set TabStop to False where you don't want them.
    Set tab order to the password field, next the vrify and next the CI button

  48. #48
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Good morning sir.

    Thank you, that works just fine. I initially wanted it to enter the clockIN/clockOUT button too, but the more I think about it, the more I realise that it is better to manually press the enter (by mouseclick or on the keyboard). That way it is possible to make sure that the employee is in deed clocked in/out.

    Thank you very very much.....

  49. #49
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Strike Enter or press the Tab key, both work since the password_Exit is triggered with both

  50. #50
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi, I changed some tab settings and tab order and a minor line of code added in both of the confirm buttons
    Now when you enter an ID the confirm CI or CO will focus and after pressing then the close button will get focus so you just strike enter to close the form.

    I didn't give your file a new version number so don't overwrite your own before testing.
    Attached Files Attached Files

  51. #51
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    I wonder if you actually calculate the time to the minute or round the clock time off
    I wrote this simple function to return the time rounded to the nearest 15 minutes. Using the formulas seen and used in different samples I combined it.
    Please Login or Register  to view this content.
    The result is the same as if you would use NOW() but rounded to the nearest 15 minutes.
    If you use this when actually registering the ClockIn or the ClockOut you won't have to do the calculations yourself.

  52. #52
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    I wonder if you actually calculate the time to the minute or round the clock time off
    I wrote this simple function to return the time rounded to the nearest 15 minutes. Using the formulas seen and used in different samples I combined it.
    Please Login or Register  to view this content.
    The result is the same as if you would use NOW() but rounded to the nearest 15 minutes.
    If you use this when actually registering the ClockIn or the ClockOut you won't have to do the calculations yourself.
    At the moment I actually prefer to clock the person to the second. It helps to eliminate people who play for time(waste time). But is not a bad idea. Where do I paste the code in?

  53. #53
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Hi, I changed some tab settings and tab order and a minor line of code added in both of the confirm buttons
    Now when you enter an ID the confirm CI or CO will focus and after pressing then the close button will get focus so you just strike enter to close the form.

    I didn't give your file a new version number so don't overwrite your own before testing.
    I prefer it to go back to the password box, because a few people clock in and out at the same time

  54. #54
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Well, judt set that in the code, the focus instead of the close1 button
    The now15 code just in one of the vba modules, I would use one of the existing modules and replace the Now() when rregidtering or closing with Now15

  55. #55
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Did you manage to modify the code?

  56. #56
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Did you manage to modify the code?
    Looks like I messed it up

    When I modified the code, the program froze when I tried to run it.

    Luckily I made a copy

  57. #57
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Just remove the two lines of code: (marked in red)

    Please Login or Register  to view this content.

  58. #58
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Just remove the two lines of code: (marked in red)

    Please Login or Register  to view this content.
    sorry... I should have been more specific....

    When I modified/entered the now15 code, the program froze when I tried to run it.

  59. #59
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Okay, clear,
    I checked and modified it for you.
    Hope this works, (make sure you keep your copy safe first)
    Attached Files Attached Files

  60. #60
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    That is working just fine thank you.

    Again... you are my hero. Thank you very much for all your effort and help sir.

  61. #61
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Glad it helped, and that I could be of assistance.
    Don't forget to mark the post SOLVED.

  62. #62
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Will do, thank you

  63. #63
    Registered User
    Join Date
    07-31-2019
    Location
    Sydney
    MS-Off Ver
    10
    Posts
    2

    Re: Need help with Punch in and Punch out clock system please.

    Hi All,
    I Love this page,
    And i have tried downloading the punchclock to use with a barcode scanner but i cant get it to work,
    can anyone help?
    I would like my employees to scan their barcore on the way in and out each day, very simple
    with a excel table by name,Monday date , Tuesday date , wednesday date , thursday Date, friday Date, Saturday Date, Sunday Date
    and underneath the dates in line 2 it will give me the hours work per day

  64. #64
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Need help with Punch in and Punch out clock system please.

    I had no problem downloading and opening the file from post #59
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  65. #65
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by JasM View Post
    Hi All,
    I Love this page,
    And i have tried downloading the punchclock to use with a barcode scanner but i cant get it to work,
    can anyone help?
    I would like my employees to scan their barcore on the way in and out each day, very simple
    with a excel table by name,Monday date , Tuesday date , wednesday date , thursday Date, friday Date, Saturday Date, Sunday Date
    and underneath the dates in line 2 it will give me the hours work per day
    I have a file that calculate all the hours. Send me what you got/want, and I will try and modify it for you. Its actually a SUMIF and LOOKUP formula that I used.

  66. #66
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi JasM, welcome to the forum.
    May I suggest you start a new thread with your question.
    I do not see any reason why you shouldn't be able to download the attached file in post #59.

  67. #67
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi Eugene,
    I just suggested JasM to start his/her own thread

  68. #68
    Registered User
    Join Date
    08-14-2018
    Location
    Ceres, South Africa
    MS-Off Ver
    pro plus 2010
    Posts
    46

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Hi Eugene,
    I just suggested JasM to start his/her own thread
    ok... cool

  69. #69
    Registered User
    Join Date
    07-31-2019
    Location
    Sydney
    MS-Off Ver
    10
    Posts
    2

    Re: Need help with Punch in and Punch out clock system please.

    hi all

    I come up with a Debug .
    When i open debug
    I get the error in yellow

    Application.Caption = Captiontxt
    Application.EnableEvents = True
    Worksheets(mSheet).Activate
    ActiveSheet.Protect UserInterfaceOnly:=True
    Dim zRange As String

  70. #70
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Need help with Punch in and Punch out clock system please.

    JasM, as suggested, please start your own (new) thread for your question. Make reference to this thread if you think it is particularly relevant.

  71. #71
    Registered User
    Join Date
    12-19-2019
    Location
    Newnan, GA
    MS-Off Ver
    365
    Posts
    4

    Re: Need help with Punch in and Punch out clock system please.

    Quote Originally Posted by Keebellah View Post
    Okay, I'll look at your files and see what's wrong.
    In the meantime I implemented the 'external' log file.
    You will have to indicate the folder where you want the log file to be placed.
    A new log file will be created automatically on the first day of each new month upon the first action with the file
    The logs filename will be YYYY-MM-Monthname ful-out.xlsx
    No provisions made yet if the works night shift and he logged in the last day of the month and wants to log out the first day of the new month.
    The new log file is a copy of the hidden EMPLOYEE_LOG file, so if you add columns there these will be copied too.


    Hellow Keebellah,

    I'd like to make something like this for just myself to track my daily hours. We don't clock in or out here so it's an hour system. But with that, sometimes my boss forgets to write down my OT. I'd like to be able to more accurately track it. I just want something easy that I can click a button to clock in, clock out and it logs the dates, times, and total hours automatically. Would be cool if it would auto calculate the OT (anything beyond 8 hrs). I just want to be able to audit my paychecks. Thanks for any help.

  72. #72
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Need help with Punch in and Punch out clock system please.

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  73. #73
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need help with Punch in and Punch out clock system please.

    Hi there,
    By now you will have read the administrator's note.
    Once you've created your own thread drop me a PM with the link and I'll try and help.
    You haven't mentioned your VBA skills,

  74. #74
    Registered User
    Join Date
    02-26-2020
    Location
    Seattle
    MS-Off Ver
    Excel 2016
    Posts
    1

    Re: Need help with Punch in and Punch out clock system please.

    HI Keebellah,

    I am trying to open this Excel on MacBook MS Excel 2019 and i am getting error .
    1. This workbook contains content that isn't supported in this version of Excel
    2.Microsoft Visual Basic compile error - The code in this project must be updated for use on 64-bit systems.

    I don't have access to upload images thats why i pasted the error messages.

    Could you please help me to resolve these issues in your excel.

  75. #75
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Need help with Punch in and Punch out clock system please.

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with Punch Clock
    By horsefish01 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-24-2018, 08:54 AM
  2. Punch in Time clock problem
    By giverny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2018, 06:43 AM
  3. Punch-in clock broken at work - need to address pay discrepancies
    By RookA1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2017, 12:48 PM
  4. [SOLVED] Punch Clock
    By domnicess in forum Excel General
    Replies: 6
    Last Post: 06-10-2014, 11:53 AM
  5. Clock in multiple punch in/punch out times Formula
    By Schnizzle74 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-24-2014, 06:15 PM
  6. Analysis of Punch Clock Data in new format
    By samfarrugia in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-02-2012, 08:08 AM
  7. Help with macros for employee punch clock
    By rageo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2009, 10:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1