Results 1 to 4 of 4
  1. #1
    jimjam is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2

    Trying to create a function that removes the carriage return from a string .

    Any idea why this does not work?

    Public Function fNixCr(sIn As String)
    sIn = Replace(sIn, vbCrLr, "")
    sIn = Replace(sIn, vbCr, "")
    fNixCr = sIn



    End Function



    Immediate window:
    ?fNixCr("Hello" & vbCrLf & "multiverse")
    Hello
    multiverse


    I would have expected this to print:
    Hellomultiverse

    Flummoxed.

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    sIn = Replace(sIn, vbCrLr, "")
    Try replacing vbCrLr with vbCrLf

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  4. #4
    jimjam is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2
    <cringe> thanks guys. lol.

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

Similar Threads

  1. Replace function adding in unwanted carriage return
    By timmygrover in forum Queries
    Replies: 10
    Last Post: 07-02-2012, 11:58 AM
  2. Replies: 1
    Last Post: 02-08-2012, 04:44 PM
  3. Carriage return in a CSV file
    By btidwell3 in forum Import/Export Data
    Replies: 1
    Last Post: 09-09-2011, 05:19 PM
  4. MySQL Linked Tables - Carriage Return
    By warrenk in forum Access
    Replies: 1
    Last Post: 03-28-2010, 01:56 AM
  5. How to force carriage return between strings?
    By Divardo in forum Reports
    Replies: 1
    Last Post: 05-21-2009, 10:50 AM

Tags for this Thread

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