Removing carriage returns

  • Thread starter Thread starter James
  • Start date Start date
J

James

Does anyone have a method of removing carriage returns created from a memo
field.

Data imported form CSV file

Thanks
James
 
Depending on your version of Access you might be able to run an update query
on the imported date that replaces chr(13) & Chr(10) with a space.
 
Does anyone have a method of removing carriage returns created from a memo
field.

Data imported form CSV file

Thanks
James

Which version of Access?
What do wyou want in it's place?

The below replaces the returns and line feed with a space.
Access 2000 and later
NewField:Replace([MemoField],chr(13) & chr(10)," ")

In Access 97 you will need to write your own user defined function to
do this. If you need help, post back.
 
Do you want to remove CR's before the conversion to CSV,
while converting the CSV to Table form or after it is in
the the table?
 
For Access 97:

Public Function ReplaceCR_LF(ToBeFormatted As String) As String

Dim L As Integer
Dim Formatted As String
Formatted = ToBeFormatted

For L = 1 To Len(Formatted)
If Mid$(Formatted, L, 1) = Chr$(13) Or Mid$(Formatted, L, 1) =
Chr$(10) Then
Formatted = Left$(Formatted, L - 1) & " " & Right$(Formatted,
Len(Formatted) - L - 1)
End If
Next
ReplaceCR_LF = Formatted

End Function
 
Back
Top