Results 1 to 4 of 4

Thread: Question concering command button

  1. #1
    sonsofliberty00
    Guest

    Question Question concering command button

    When I add this code to my under my command button:

    MsgBox Text1.Text & " plus " & _
    Text2.Text & " equals " & Text1.Text + Text2.Text

    and use 5 for text1 and 5 for text2 the value given is 55. Have I missed something or am I losing my mind?

    Nick

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    yes you have missed something. "+" can be used to concat strings, too. Try this :
    VB Code:
    1. MsgBox Text1.Text & " plus " & _
    2. Text2.Text & " equals " & (Val(Text1.Text) + Val(Text2.Text))

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    sonsofliberty00
    Guest
    Thanks! I am just learning how to do VB. This threw me for a loop.

  4. #4
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    lol I think we all did that at one time

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