[AccessD] Find and Remove Carriage Return

Reuben Cummings reuben at gfconsultants.com
Fri Jun 2 21:49:12 CDT 2006


I'm not really sure what I mean.

I have some text fields and I am putting them together to make a fixed
length text file.  When I grab a field that has been "Entered/Returned" in
the text field reads the Return and starts a new line.  Which of course
screws up the fixed length definition of the text file.

Do all carriage returns show as vbcrlf within any stored string?

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Heenan,
Lambert
Sent: Friday, June 02, 2006 4:51 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Find and Remove Carriage Return


Presumably you really mean Cr Lf combinations, i.e. what looks like a new
line to us humans. In VB land this is the string vbCrlf.

To do this in a query you need a simple one-line function, because JET does
not see VB constants...

Function CrLf() as String
	CrLf = vbCrLf
End Function

Armed with this you can update the text/memo field in a query with this sort
of SQL...

UPDATE Table1 SET Table1.[yet another memo] = Replace(Cstr(nz([yet another
memo],"")),CrLf(),"");


The part that does the work being

Replace(Cstr(nz([yet another memo],"")),CrLf(),"")


HTH

Lambert


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Reuben Cummings
Sent: Friday, June 02, 2006 4:26 PM
To: AccessD
Subject: [AccessD] Find and Remove Carriage Return


How can I look into a field and find and remove any returns?

Thanks.

Reuben Cummings
GFC, LLC
812.523.1017




--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com







More information about the AccessD mailing list