Code to remove line breaks in table

reedhillltd

New member
Local time
Today, 12:02
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.
 
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) & "*"
 
might not even need the WHERE in there either.
 
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?
 
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

Back
Top Bottom