Results 1 to 3 of 3

Thread: Why is it converting to long?

Hybrid View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Posts
    24

    Why is it converting to long?

    Im having problems with this code

    MsgBox(txtInsertName.Text And txtInsertAge.Text)

    This code will work and gives me the text in the text box

    MsgBox(txtInsertName.Text)

    But if I put "and txtInsertAge.text" then it gives an exception on whatever value is in txtInsertName stating;

    Conversion from string "bob" to type 'Long' is not valid.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Why is it converting to long?

    and is a bitwise operator.
    for string concatenation use &

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Posts
    24

    Re: Why is it converting to long?

    thanks. works now. and looks quite a bit familiar.

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