Results 1 to 4 of 4

Thread: Converting String to a number

  1. #1

    Thread Starter
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396

    Converting String to a number

    I'm writing a pogram, a simple one that calculates certain number -which works like this...

    User enters any number in a textBox
    and on click of the command button the number should be incremented by 1.

    Its working but if I enter 001 into textbox it returns 2 on clicking command1...please help...I want it to be 002

    Here's my code:
    Dim nu As Long
    nu = Val(Text1.Text)
    MsgBox nu

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    Just format the output Text1.Text = format$(2,"000")
    Regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  3. #3
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274

    Re: Circular Reference Problem

    You lost there Marty???
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  4. #4

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