Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Posts
    11

    Question Unanswered: How to add spaces to text string?

    Access 2000. I have table of many hundreds of records. One of th fields of text looks like this: XXXXXXXXXXXX and I want it to look like this: XXX XXX XXX XXX by adding the spaces. Would someone please show me how to write the function or code to add the spaces to the text as shown : Thanks.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Look at the Mid() function, which will let you pull 3 character groupings out of the middle, perhaps along with the Left() and Right() functions. Then:

    Left(FieldName,3) & " " & Mid(...) & " " & ...
    Paul

  3. #3
    Join Date
    Sep 2005
    Location
    Schaumburg, IL
    Posts
    28
    function SPACE() in ms access will help

  4. #4
    Join Date
    Jun 2005
    Posts
    11
    Quote Originally Posted by pbaldy
    Look at the Mid() function, which will let you pull 3 character groupings out of the middle, perhaps along with the Left() and Right() functions. Then:

    Left(FieldName,3) & " " & Mid(...) & " " & ...
    Pbaldy, thanks very much. Worked great!

  5. #5
    Join Date
    Jun 2005
    Posts
    11
    Quote Originally Posted by Vincentg
    function SPACE() in ms access will help
    Thanks. I haven't seen this function before. I'll give it a try.

Posting Permissions

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