Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Calculating hours (2002)

    Hi,

    I'm trying to calculate the total time between two time frames. This is what I tried but it doesn't yield anything.

    Me.hours.Value = Hour(Me.txtEnd) - Hour(Me.txtStart)

    I put the code on the after update function of [txtend]

    What am I missing?

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculating hours (2002)

    I wouldn't use code, I'd put the following expression in the Control Source of the Hours text box:

    =[txtEnd]-[txtStart]

    and format it with a time format. The underlying value will still be a time value. If you need the number of hours, use

    =24*([txtEnd]-[txtStart])

    and format it as a number.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculating hours (2002)

    Perfection!!!!

    Thanks,
    Leesha

Posting Permissions

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