Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Location
    Iowa
    Posts
    13

    Exclamation Unanswered: Time Total Question?

    I am constructing a time sheet database in Access 2000. I have a form set up to enter date and time for when one begins the project, and a date and time text box for when they finish the project.

    I am trying to incorporate a Total Time text box, without the user actually entering their own data. Basically i need to know how to have that Total Time field calculate the totals automatically. Hopefully this is an easy question and i here from people soon! Thanks

    BEN

  2. #2
    Join Date
    Feb 2004
    Location
    Swindon, UK
    Posts
    86
    within VBA, do an afterupdate event on the finish time box as follows

    Sub FinishTime_AfterUpdate()

    TotalTime.Value = FinishTime-StartTime

    End Sub

    check the format of the text boxes so that they are on either a date or time format.

  3. #3
    Join Date
    Jun 2004
    Location
    Iowa
    Posts
    13

    Question Great Start

    Thanks for the help...

    That works, kind of...

    I have the TotalTime text box figuring it when the EndTime is entered, but it is not in understandable format. So i dont know if it is not working, or if i need to change settings.

    My goal is to produce an output for example...

    starttime=2:00pm
    endtime=4:30pm
    totaltime=2.5 hours

    Thanks again.

    BEN

    ps-is there an easy way to round to the nearest quarter hour???

  4. #4
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313
    Not sure of an easy way to round to quarter hours but

    totaltime.value = (endtime - starttime)*24

    should give you hours.

    HTH

Posting Permissions

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