Results 1 to 4 of 4
  1. #1
    markswan20 is offline Novice
    Windows 11 Office 365
    Join Date
    Oct 2022
    Posts
    1

    Calculating times in a form using hh:nn:ss

    Hi everyone,



    I have looked at a few different posts relating to my question but I'm struggling to adapt what I've found to facilitate my requirement.

    I have a basic table that has 3x fields time1 - time2 -time3 all using the data type date/number with input mask 00:00:00

    The user enters a time as format hh:nn:ss

    Example

    time1 10:29:10
    time2 00:12:01
    time3 21:32:51

    How would i create a field within the form to auto calculate the 3 values to add up to equal the total of 32:14:02

    Thanks in advance

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,980
    Have you tried to add them?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,811
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,444
    the time format is for hours in a day - so a maximum of 23 hours (24 hours takes you to the next day)

    32 hours is greater than a day so when you add them you will get

    1 Day 8 hours.....

    so to return 32 you could try this

    ?format(datediff("h",#00:00:00#,#10:29:10# + #00:12:01# + #21:32:51#),"00:") & format(#10:29:10# + #00:12:01# + #21:32:51#,"nn:ss")
    32:14:02

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

Similar Threads

  1. Continuous form is showing first record 680 times???
    By scott0_1 in forum Programming
    Replies: 9
    Last Post: 06-22-2018, 10:49 AM
  2. requery multiple times in same form
    By pyromaniac511 in forum Forms
    Replies: 2
    Last Post: 06-19-2016, 11:36 AM
  3. Replies: 2
    Last Post: 02-25-2015, 05:02 PM
  4. Replies: 4
    Last Post: 12-11-2012, 05:27 PM
  5. Replies: 3
    Last Post: 06-08-2009, 08:20 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