PDA

Click to See Complete Forum and Search --> : Adding of label numeric label caption together


BJK
Nov 29th, 1999, 08:45 AM
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

MartinLiss
Nov 29th, 1999, 09:36 AM
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