473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Deleting carriage returns

I need to strip out carriage returns from a memo field. Basically, one of
the commercial databases we have uses a memo field for the address, and what
I'd like to do is get rid of the carriage returns so I can have the address
on a single line (possibly separated by commas) in a different database. Any
suggestions gratefully received.

Apologies if you replied to this earlier, I think my ISP must have dropped
the newsgroup a week or two ago and has only just started to receive it
again.

Dave
Nov 13 '05 #1
3 2003
This should work in Access 2000, 2002 and 2003:

1. Create a query into this table.

2. Change it to an Update query. (Update on Query menu).
Access adds a new row to the grid.

3. Drag the memo (named MyField in this example) into the grid.
In the Update row, enter:
Replace([MyField], Chr(13) & Chr(10), ", ")

4. Run the query.

If you have problems in A2000, see:
http://support.microsoft.com/?id=225956

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <no****@yourbusiness.com> wrote in message
news:41***********************@ptn-nntp-reader02.plus.net...
I need to strip out carriage returns from a memo field. Basically, one of
the commercial databases we have uses a memo field for the address, and
what
I'd like to do is get rid of the carriage returns so I can have the
address
on a single line (possibly separated by commas) in a different database.
Any
suggestions gratefully received.

Apologies if you replied to this earlier, I think my ISP must have dropped
the newsgroup a week or two ago and has only just started to receive it
again.

Nov 13 '05 #2
Thanks Allen

I gave it a go exactly as you suggested, but it comes up with 'UNDEFINED
FUNCTION REPLACE IN EXPRESSION'. I know SQL can handle replace, but it
doesn't look as though Access recognises it within this particular case. I'm
using Access 2000 and the link you included refers to problems evaluating
time and date expressions.

Dave

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
This should work in Access 2000, 2002 and 2003:

1. Create a query into this table.

2. Change it to an Update query. (Update on Query menu).
Access adds a new row to the grid.

3. Drag the memo (named MyField in this example) into the grid.
In the Update row, enter:
Replace([MyField], Chr(13) & Chr(10), ", ")

4. Run the query.

If you have problems in A2000, see:
http://support.microsoft.com/?id=225956

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <no****@yourbusiness.com> wrote in message
news:41***********************@ptn-nntp-reader02.plus.net...
I need to strip out carriage returns from a memo field. Basically, one of
the commercial databases we have uses a memo field for the address, and
what
I'd like to do is get rid of the carriage returns so I can have the
address
on a single line (possibly separated by commas) in a different database.
Any
suggestions gratefully received.

Apologies if you replied to this earlier, I think my ISP must have dropped the newsgroup a week or two ago and has only just started to receive it
again.


Nov 13 '05 #3
The kb article lists these functions as having the problem:
FormatCurrency(),
FormatDateTime(),
FormatNumber(),
FormatPercent(),
InStrRev(),
MonthName(),
*Replace()*,
Round(),
StrReverse(),
WeekdayName()

The kb article suggests making a wrapper fucnction, and calling that
function instead of trying to use Replace(), in any context that requires
the Expression Service in A2000. The query context does use the ES.
Function MyReplace(strExpression As String, _
strFind As String, _
strReplace As String, _
Optional lngStart As Long = 1, _
Optional lngCount As Long = -1) As String

MyReplace = Replace(strExpression, strFind, strReplace, lngStart,
lngCount)
End Function
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <no****@yourbusiness.com> wrote in message
news:41***********************@ptn-nntp-reader02.plus.net...
Thanks Allen

I gave it a go exactly as you suggested, but it comes up with 'UNDEFINED
FUNCTION REPLACE IN EXPRESSION'. I know SQL can handle replace, but it
doesn't look as though Access recognises it within this particular case.
I'm
using Access 2000 and the link you included refers to problems evaluating
time and date expressions.

Dave

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
This should work in Access 2000, 2002 and 2003:

1. Create a query into this table.

2. Change it to an Update query. (Update on Query menu).
Access adds a new row to the grid.

3. Drag the memo (named MyField in this example) into the grid.
In the Update row, enter:
Replace([MyField], Chr(13) & Chr(10), ", ")

4. Run the query.

If you have problems in A2000, see:
http://support.microsoft.com/?id=225956

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <no****@yourbusiness.com> wrote in message
news:41***********************@ptn-nntp-reader02.plus.net...
>I need to strip out carriage returns from a memo field. Basically, one
>of
> the commercial databases we have uses a memo field for the address, and
> what
> I'd like to do is get rid of the carriage returns so I can have the
> address
> on a single line (possibly separated by commas) in a different
> database.
> Any
> suggestions gratefully received.
>
> Apologies if you replied to this earlier, I think my ISP must have dropped > the newsgroup a week or two ago and has only just started to receive it
> again.



Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
2
by: eagleofjade | last post by:
I am trying to import data from a Word document into an Access table with VBA. The Word document is a form which has various fields. One of the fields is a field for notes. In some cases, this...
0
by: Maxxam | last post by:
Hi, I have a simple question but i can't solve it simple. How can i remove carriage returns and linfeed characters , \n\r, form a string? Thanks, Andre
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
8
by: TheDude5B | last post by:
Hi, I have some data which is stored in my MySQL database as TEXT. when the data is entered in, it has some carriage returns in it, and this can be seen when querying the data using MySQL Query...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
2
by: GregBeagle | last post by:
Windows XP I have a simple form from which I want to generate an email with the contents of the form. I use carriage returns to format the content for readability. When I test it on my computer...
0
by: markus.shure | last post by:
Hi, I'm noticed a problem testing a JAX-WS client with a WSE server. The JAX-WS client adds carriage returns to a SOAP header element that is signed. This causes the WSE server to raise an...
11
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.