Carriage Returns - remove

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

Hey Guys,

Anyone know how I can check for carriage rerurns in a memo field and if
thier are any strip them out?

I am only a basic user of access and use the query window to filter my data,
so looking for an answer using that and not writing code, that I do not
understand.

Thanks
Phil
 
Hey Guys,

Anyone know how I can check for carriage rerurns in a memo field and if
thier are any strip them out?

I am only a basic user of access and use the query window to filter my data,
so looking for an answer using that and not writing code, that I do not
understand.

Thanks
Phil

Depends upon your version of Access.
If you have Access 2000 or newer:
Exp:Replace([MemoField],chr(13) & chr(10)," ")

The above will remove the return and replace it with one space.
NOTE: some versions of Access 2000 do not permit the use of the
replace function directly in a query, so you'll need to create a User
Defined function in a module:

Public Function RemoveReturns([FieldIn as String) as String
Replace([MemoField],chr(13) & chr(10)," ")
End Function

Then call it from the query:
Exp:RemoveReturns([Memofield])

If you have Access 97 or older you will need to write a User Defined
function. Post back if this is the case and you need help with it.
 
Back
Top