Results 1 to 9 of 9
  1. #1
    Karaline's Avatar
    Karaline is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2017
    Location
    Just North Of Antartica
    Posts
    38

    Question entering hours into form but break time is having format issue


    Hello I have a form and i am entering
    starttime
    breaks
    finishtime

    i had it set to date/time but it wouldn't calculate. changed the breaks to number and it calculated, but when i enter the breaks it looks as if it is a whole number and entering 4hours and 75 minute break is not possible without doing manual calculation first.
    Help is appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Well, if breaks was date/time, you'd have to enter a decimal value, or format the textbox as time so it would get interpreted correctly. One way or the other you're going to have to calculate, so you just need to decide. I'd probably have the start and finish as date/time, and the break as a number (minutes), but it depends on how you want to enter.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Karaline's Avatar
    Karaline is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2017
    Location
    Just North Of Antartica
    Posts
    38
    i have calculation set up and all is working (kind Of) because the break format is showing 75 minutes as 75.00 it is causing issues if I have to enter a break of 2hours and 20 minutes.
    =(DateDiff("n",[Start],[End])-[Breaks])/60
    how do i fix the format of the break field? can't find an answer specific to this on google. my formula works until i need to enter hours into break total.

    StartTime Breaks FinishTime VStart VFinish
    11:00
    17:30 0 0
    14:00 0.00 15:30 0 0
    7:00 110 16:00 0 0
    10:00 0.00 11:00 0 0
    7:00 0.00 10:10 0 0

    0.00
    0 0

    0.00
    0 0

    0.00
    0 0

    0.00
    0 0
    9:15 24 16:15 0 0
    7:00 90
    0 0
    7:00

    0 0
    9:15 47 16:15 0 0

  4. #4
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Post #14 has this done. you can download it and manipulate for your needs.

    https://access-programmers.co.uk/for...d.php?t=164255

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Without knowing how you are entering the date/times and the break time, it is very hard to give a good answer.
    Do you have a picture of the form? Can you post the dB?

    Do you have a control for the start time, a control for the end time and a control for the break time in hours? In minutes?
    Two controls: 1 for hours and 1 for minutes?
    More that 3 controls? How many controls/breaks?

    If you had two controls (hours and minutes), you could enter in 2 hours and 30 minutes (NOT 2.5 hours), convert to minutes and calculate the total break time in minutes so you wouldn't have to manually do the calculation. You could enter 0 hours and 90 minutes (instead of 1 hr and 30 min) and still get a valid number.

    Say the start time is 8am and the end time is 5pm. There is a 1 hr lunch, a morning break of 15 minutes and an afternoon break of 15 minutes. That is a total of 1hr and 30 min.
    Are you calculating [end time] - [start time] - [break time]??

  6. #6
    Karaline's Avatar
    Karaline is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2017
    Location
    Just North Of Antartica
    Posts
    38

    Question Still having Issue with Decimal Format IN Form

    Click image for larger version. 

Name:	Time Issue.png 
Views:	8 
Size:	3.9 KB 
ID:	27551Will try and explain again.
    I have a start time
    06:00 perfect enters correctly
    Finish time
    18:00 perfect enters correctly
    Breaks enter as an hour time if you have a 30 minute break you would enter as below
    0.30 Perfect BUT when you click tab to go to finish Time it changes the look and turns into 30.00

    now that is a problem because if i have to enter total breaks due to breakdown as 2 hours and 45 minutes i have to multiply 60 x 2.75 to get the number to enter.
    i then have to enter into the form cell as
    1.65 it then turns into 165 when i leave the cell.

    this isn't answered in above link.
    Please help this has been an ongoing issue for a month and i need to solve it today.
    Actually working on a Saturday on my own time to solve this issue.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    See attached dB for one way to do the calculations.

    One form uses "Query1" as the record source. "Total Hours" NOT saved to the table.
    One form uses "Table1" as the record source. "Total Hours" is saved to the table.
    Attached Files Attached Files

  8. #8
    Karaline's Avatar
    Karaline is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Jan 2017
    Location
    Just North Of Antartica
    Posts
    38
    Thanks Steve,
    Will work. will change the table to store separate fields for hours and minutes. i am sure there is another way but i am happy with anything. Thank you so much...
    It is 9:10pm Saturday night. I am pushing it but need to get the queries finished by Sunday morning.
    I will change the forms.
    I don't store any calculations in tables.

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    2:41 AM Saturday here.


    Happy you were able to use it.....


    Good luck with your project...

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

Similar Threads

  1. Replies: 5
    Last Post: 05-14-2014, 03:19 PM
  2. Replies: 6
    Last Post: 02-18-2014, 05:32 PM
  3. Replies: 7
    Last Post: 10-05-2013, 08:43 AM
  4. Replies: 4
    Last Post: 08-06-2012, 10:25 AM
  5. Replies: 2
    Last Post: 04-24-2012, 01:26 PM

Tags for this Thread

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