By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 2,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

Removing Carriage Returns

P: n/a
Hi All,

I am trying to remove carriage returns from a text field via some code.

Here is an example of what I am up against.

The field streetname contains the little square box that I believe is a
carriage return.

So, the field will have text, the little square box and more text. I
am trying to remove whatever that little box is. I tried to paste it
into this but it just moved the latter text to a new line, hence the
carriage return.

Any help would be appreciated.

Thanks

Jun 8 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
if string s contains your address, one of the following will do the trick:

(most likely case first)

s = replace(s, vbcrlf, ", ") 'if it's a CR/LF pair, you'll
get a comma instead

or

s = replace (s, chr(10), ", " 'if it's just a Line Feed, you get a
comma instead

or

s = replace (s, chr(13), ", " 'if it's just a Carraige Return, you
get a comma instead
Jun 8 '06 #2

P: n/a
Rick,

Thanks so much and I definitely was making that much more difficult
than it needed to be.

It was the 2nd one that did the trick.

Thanks Again,

Jun 8 '06 #3

P: n/a
Great.

By the way, there are constants for those other things. I just forgot about
them? vbCr and vbLf are chr(13) and chr(10) respectively.
Jun 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.