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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove new line and tab in table field

Status
Not open for further replies.

lily1

Programmer
Mar 13, 2004
17
US
My table gather information from a form, some users filled form with new line or tab in the "description" field, I want to remove these new lines and tab in the table, I tried using immidiate window, and typed:
DoCmd.RunSQL: "UPDATE Property SET Property.[Desc] = Replace(Desc,Chr(13) & Chr(10) & Chr(9),"""")"
After hit enter, I get error:
compile error:
expected: line number or label or statement or end of statement.

I am new to Immediate window and can anybody tell me where I am wrong or tell me how to remove those new lines and tabs in the table?
Thanks for help!
 
I just copy the syntex from other people's post, I never used immediate window before.
I have fixed the problem by using query feature. But if you do not mind, could you please tell me what is the correct syntex to use immediate window?
Thanks!
 
Code:
DoCmd.RunSQL "UPDATE Property SET Property.[Desc] = Replace(Desc,Chr(13) & Chr(10) & Chr(9),"""")"

The above should work, just needed to remove the :.
 
Thanks, hneal98. I I know something new :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top