Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing number format to text (A2K)

    Is there a way I can change a number to text using a select string? I need to do this because I an trying to format a hyperlink and it has to be text. However, the field in question is a number. I need to convert it only while populating this one form and not actually change the format in the table. I hope I have made sense.

    Thanks,
    Mark

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Changing number format to text (A2K)

    You didn't really explain how you need to use the number field. You can always use the format function, the CStr function, or just use the & to concatenate the number field to a string field.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing number format to text (A2K)

    Sorry Mark,
    I knew that it would be a bit unclear. I need to use that number (converted to a string) to put in a web page I am creating with Dreamweaver. The string then can be used as a hyperlink where a number can't for some reason. If I have a select string with 5 fields, how would I selectively change only one of the fields to text? I have tried the "Cstr" function and converted the whole select line but I would like to convert just one of the five.

    Thanks,
    Mark

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Edmonton, Alberta, Canada
    Posts
    326
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing number format to text (A2K)

    Assuming you can't just use implicit conversion (e.g. "ABC" & 123 converts 123 to a string and concatenates it to "ABC" giving "ABC123"), use CStr around only the number you want to convert. Might be more readable (but not necessary) to do it in a separate statement
    StrNum=CStr(Num)
    and then just use StrNum instead of Num

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •