Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 addition prob

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Dark_Lord Posted - May 29 2006 : 10:19:51 AM
hello everyone, please help me out with adding the caption of several labels. I had been doing ithese additions but now i am not able because i stopped programming for some years

here is the script

tHrs.Caption = hrs1.Caption + hrs2.Caption + hrs3.Caption + hrs4.Caption + hrs5.Caption + hrs6.Caption

Thanks
5   L A T E S T    R E P L I E S    (Newest First)
Dark_Lord Posted - Jun 01 2006 : 04:07:19 AM
Thanks Eric Coleman, It works now.
Eric Coleman Posted - May 30 2006 : 3:12:51 PM
The previous code I wrote won't work. Try this instead.
  
tHrs.Caption = CNum(hrs1.Caption) + CNum(hrs2.Caption) + CNum(hrs3.Caption) + CNum(hrs4.Caption) + CNum(hrs5.Caption) + CNum(hrs6.Caption)  
  
Public Function CNum(ByVal X As Variant) As Variant
If IsNumeric(X) = True Then
CNum = CDbl(X)  
Else
CNum = 0  
End If
End Function
  
Dark_Lord Posted - May 30 2006 : 11:35:59 AM
i want it to be added that is 4 + 5 = 9
Dark_Lord Posted - May 30 2006 : 11:32:04 AM
Hey Skyman, Thanks for you reply, but both + and & gives the same result which i dont want. I want to add the values.

I will explain what i mean as such.
Let say hrs1 = 4, hrs2 = 5
so according to this code, the resultant value would not be equal to the sum of 4 & 5 infact it would be 45. That is it does not add them but writes them together.
Please help me.

Thanks
d-skyman Posted - May 29 2006 : 6:18:44 PM
Hey Lord,

I think you would have to use the "&" symbol, not the "+" sign.

regards, d-skyman

VBGamer © Go To Top Of Page
This page was generated in 0.09 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.