Code to remove line breaks in table (1 Viewer)

reedhillltd

New member
Local time
Today, 11:12
Joined
Jun 20, 2014
Messages
6
Hello I programming a eBay upholder, and having an issue with the description, as there cant be any line breaks in the column. I have little knowledge of Vba programming. I think I can use the replace command to change the line breaks to spaces. But I cannot figure out how to implement it.
 

BlueIshDan

☠
Local time
Today, 12:12
Joined
May 15, 2014
Messages
1,122
Well first figure out what the byte or character is then:

Update table Set field = Replace(field, vbNewLine, "") WHERE field LIKE "*vbNewLine*"

other ones I know of are

Update table Set field = replace(field, Chr(10), "") WHERE field LIKE "*" & Chr(10) & "*"
Update table Set field = replace(field, Chr(13), "") WHERE field LIKE "*" & Chr(10) & "*"
 

BlueIshDan

☠
Local time
Today, 12:12
Joined
May 15, 2014
Messages
1,122
might not even need the WHERE in there either.
 

reedhillltd

New member
Local time
Today, 11:12
Joined
Jun 20, 2014
Messages
6
When I enter the data into the query

Update table Set field = replace(*description, Chr(10), "Chr(32)") WHERE field LIKE "Chr(32)" & Chr(10) & "Chr(32)"

I get a invalid syntax error
You may have entered an operand without an operator

What Am I doing wrong?
 

WayneRyan

AWF VIP
Local time
Today, 16:12
Joined
Nov 19, 2002
Messages
7,122
Reed,

Try:

Update table
Set field = replace([*description], Chr(10), Chr(32))
WHERE field LIKE "*" & Chr(10) & "*"

But, I'd remove the Where clause.

Wayne
 

Users who are viewing this thread

Top Bottom