Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    May 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    convert number to text (2k)

    I know this is mega - easy...
    I'm taking number from an external data source (link table)
    want to append it to internal table as string.

    In my append query, I'm wanting to do string(number), but that's not the syntax, and can't find it in help.
    help.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert number to text (2k)

    The right syntax is CStr(number)
    Francois

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert number to text (2k)

    You can use several expressions for this:
    <table border=1><td>Expression</td><td>Remark</td><td>Str([NumberField])</td><td>Includes a leading space for positive and zero values</td><td>CStr([NumberField])</td><td>Takes local (non-US) number formatting into account</td><td>Format([NumberField])</td><td>Can take an optional second argument to specify a format</td></table>
    An example of the latter would be Format([NumberField],"#,##0.00")

  4. #4
    New Lounger
    Join Date
    May 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: convert number to text (2k)

    thanks both of you.
    J
    PS: since there's not a nice easy list of built-in functions with descriptions in Access Help, has someone done one somewhere else?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: convert number to text (2k)

    Functions such as CStr etc. are general VBA functions, they are not specific to Access. If you start the online help, click the Contents tab and expand Visual Basic Reference, you'll find an alphabeitc list of VBA functions.

    There are few Access-specific functions (Nz is an example; you'll find them under Methods if you have the Microsoft Access Visual Basic Reference open (one way to get this is to type an Access-specific term in the Immediate window or in a module, and press F1.)

Posting Permissions

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