Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Line Conversions in Access 1

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
0
0
GB
I am using Access 2003.

I have a table with a column which contains user entered text. In some instances the user has entered the text and included 'new line', i.e. they have hit the Enter key within the text. When I export this data to a txt file, Access splits the text into multiple lines. Is there a way either the 'Enters' can be removed or overwritten or is there a method within Access whereby the 'Enters' can be ignored?

Regards

Steve
 
See Replace() function also chr(10) is a line feed and chr(13) is a carriage return, or use the builtin VBA constants vbcrlf

so you would use something like REPLACE(myString,vbcrlf,"")

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Keep in mind you can't use the vbCrLf constant in a query. VBA constants are only available in VBA. A query would require something like:
Code:
UPDATE TableName
SET ColumnName =  REPLACE(ColumnName,Chr(13) & Chr(10)," ");

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top