Results 1 to 3 of 3
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,329

    Add New Line In String

    Hi Guy's is there a way I can find a word within the text box and add 2 lines just before so it's a new paragraph ?? the text is looked up from a table of default replies

    From this

    Good Evening, Firstly, thank you for taking to time to visit us at www.ourwebsite.com.Our priority is to offer you the best advice regarding your request for your

    To This

    Good Evening, Firstly, thank you for taking to time to visit us at www.ourwebsite.com.



    Our priority is to offer you the best advice regarding your request for your

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Code:
    I = instr(txtBox, ".com.")
    if I > 0 then
      vLft = left(txtBox,4)
      vRt = mid(txtBox,4+1)
    
       txtBox = vLft & vbCrLf & vRt
    endif

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    That doesn't use the variable "I" so I can't see how it would work. It will put the return after "Good". Why not just add the returns in the table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 08-22-2017, 07:14 PM
  2. Replies: 2
    Last Post: 03-23-2015, 08:32 AM
  3. Replies: 1
    Last Post: 11-11-2014, 03:54 PM
  4. Replies: 10
    Last Post: 06-10-2014, 09:03 AM
  5. Replies: 5
    Last Post: 09-18-2013, 06:44 PM

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