Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2005

Tip: Looking for answers? Try searching our database.

Remove multiple Chr(13) & Chr(10)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lauren quantrell - 11 Feb 2005 17:23 GMT
Has anyone cunstructed a function to remove multiple carriage returns
and replace it with a single return?

Replace(mytext, Chr(13) & Chr(10) & Chr(13) & Chr(10), Chr(13) &
Chr(10)) ...

only works to remove double carriage returns.

Thanks.
lq
jimfortune@compumarc.com - 11 Feb 2005 19:25 GMT
> Has anyone cunstructed a function to remove multiple carriage returns
> and replace it with a single return?
[quoted text clipped - 6 lines]
> Thanks.
> lq

If you don't need anything elegant or efficient :-):

Do While InStr(mytext, Chr(13) & Chr(10) & Chr(13) & Chr(10)) > 0
 mytext = YourFunction(mytext)
Loop

Post back if you need something better.

James A. Fortune
Trevor Best - 12 Feb 2005 11:12 GMT
>>Has anyone cunstructed a function to remove multiple carriage returns
>>and replace it with a single return?
[quoted text clipped - 16 lines]
>
> James A. Fortune

A little simpler would be:

Do While Instr(1,mytext,vbCrLf & vbCrLf)
  mytext=Replace(mytext,vbCrLf & vbCrLf, vbCrLf)
Loop

Signature

This sig left intentionally blank

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.