Results 1 to 6 of 6
  1. #1
    NightWalker's Avatar
    NightWalker is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    Midwest USA
    Posts
    253

    Best way of entering time.

    I have been tasked with creating a DB that will allow employees to enter the time they arrived at work and what time they leave. I then need to have it calculate the hours that they were at work to every 6 minutes. Every 6 min is 0.1 hours. Anything less than a complete 6 minutes is to be rounded down to the lower tenth of an hour. I have searched for time sheet templates but my supervisor does not like the way any of them function. What is the best way to have the time entered so it can be manipulated to find the hours a person worked. There should also be an option for 2 different schedules. one is normal 5 days at 8 hours and the other is 4 days of 9 hours and every other Friday 8 hours.

    I hope I have put everything in here that I am needing to do. I have been trying to use the Now() and Time() functions but that does not work if the employee does not login as soon as they arrive at work.

    Any help would be greatly appreciated. I can clarify anything if my post is confusing.

    Thank you for your time,
    Walker

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Always make start and end time,as DATE/time. The date and the time in one
    single field. You CAN make 2 text boxes, 1 to enter the date, 1 to enter the time, but they both feed the same field.
    users like the 2 different formats. For the time entry you can use a combo box for users to pick the time in your increments.
    (but not restrict it)

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    but that does not work if the employee does not login as soon as they arrive at work.
    This is an administrative problem, not a technical (programming) problem.

    I worked for my dad and he had a time clock that stamped the date/time on the card.
    If I came in late, I couldn't dial back the clock (ie enter my own time), I had to use the time on the clock. Why is this different??

    Enter your user ID and password, then click the button. The time is the time... No???

  4. #4
    NightWalker's Avatar
    NightWalker is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    Midwest USA
    Posts
    253
    You CAN make 2 text boxes, 1 to enter the date, 1 to enter the time, but they both feed the same field.
    How do two text boxes feed one field?

    Enter your user ID and password, then click the button. The time is the time... No???
    Sometimes the production guys don't use the computer until the end of the day.


    I'm not trying to use it as a time clock just a time Log. The supervisor wants to be able to use this to verify what is entered on their actual time sheets that are submitted to accounting.

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    I'll take a shot. Use StartDate, StartTime, EndDate, EndTime. Use Inputmask ShortDate on date fields and MediumTime on time fields.

    In code(or can probably do with nested queries):

    Dim vStartDateTime, vEndDateTime as DateTime
    Dim Total_Units_Worked as Integer

    vStartDateTime = StartDate & " " & StartTime
    vEndDateTime = EndDate & " " & EndTime

    Total_Minutes = DateDiff ("n", vStartDateTime, vEndDateTime) - this will get you total minutes for the day.
    Total_Units_Worked = Total_Minutes / 6

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    One small change. You have to explicitly declare variable types in VBA.
    Code:
    Dim vStartDateTime, vEndDateTime as DateTime
    This line declares "vStartDateTime" as a variant type and "vEndDateTime" as DateTime type.


    Use
    Code:
    Dim vStartDateTime as DateTime, vEndDateTime as DateTime

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 05-21-2016, 08:51 AM
  2. Entering data into to eh tabel the first time
    By Lou_Reed in forum Access
    Replies: 10
    Last Post: 05-17-2016, 01:33 PM
  3. Replies: 1
    Last Post: 03-20-2013, 02:57 AM
  4. Replies: 2
    Last Post: 04-24-2012, 01:26 PM
  5. Automatically enter today's date when entering time
    By Szabi in forum Database Design
    Replies: 5
    Last Post: 03-16-2012, 03:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums