Results 1 to 2 of 2

Thread: Adding of label numeric label caption together

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    12

    Post

    I have a label with a value of 00:00:06 (numeric)as the caption. Ihave another label with a numeric caption of 00:00:03. How do I add both captions together to get a result on a third label caption?. What is the formula I should use?

    Thanks in advance

    bjk

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    I don't have time to do the whole thing, but here is a general method, and I'm sure you can actually do the code yourself. First break each label caption into three fields: hours, minutes and seconds using the Left, Mid and Right functions. Then add the seconds together, If the total is > 59, sub tract 59 and add the remainder to one of the minutes fields. Handle the minutes in a similar fashion, adding any remainder to the hours. Once you have the three totals, do something like lblThree.Caption = intHoursTot & ":" & intMinsTot & ":" & intSecsTot

    ------------------
    Marty

Posting Permissions

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



Click Here to Expand Forum to Full Width