Results 1 to 4 of 4
  1. #1
    priceman31 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Location
    Tampa, FL
    Posts
    7

    Question Split Comma Separated Text on Separate Lines of Texbox

    I have very limited skills when it come to VBA. I am trying to break each part of a comma separated string into a form field with each comma separated value on it own line.
    For example the field name is Tester and a single string value would be stored as blue, red, orange, black, green. What I want to do is separate each value on a new line but still in a single form field.

    The Form field (Text Box) ideally would look like blue,
    red,
    orange,
    black,
    green,

    I hope that makes sense.




    I have tried using the Split function but have been able to figure out how to get each value on its own separate line. Any help would be greatly appreciated.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Expression in textbox:

    = Replace(Nz([Tester],""), ",", "," & Chr(13) & Chr(10))

    If you don't really need the comma at the end of each line then don't concatenate it.

    Is there a space following the comma?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    priceman31 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Location
    Tampa, FL
    Posts
    7
    When I tried that I got a #size error. Not sure if I did something wrong. I even tried removing the extra comma at the end and no luck.

  4. #4
    priceman31 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2017
    Location
    Tampa, FL
    Posts
    7
    I got it working...thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-07-2015, 04:02 PM
  2. Replies: 8
    Last Post: 06-04-2014, 10:41 AM
  3. exporting query to text comma separated
    By Pasi in forum Queries
    Replies: 6
    Last Post: 12-27-2013, 06:42 PM
  4. Replies: 8
    Last Post: 11-21-2013, 11:28 AM
  5. Replies: 1
    Last Post: 07-31-2009, 03:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums