Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Replace Carriage Return CHR(13) ?

132 views
Skip to first unread message

Sweet

unread,
Jul 12, 2002, 5:14:05 PM7/12/02
to
Hi,

I need to replace a carriage return in a query with a space. I am told that
chr(13) is a CR, but is there somewhere on the web anyone knows where I can
get a full list of character codes?.

The problem I have is that when I run code to replace a CR using chr(13)
(Acc97), I get a square box as a replacement instead? I used the code from
http://www.mvps.org/access/strings/str0004.htm which was kindly recommended
by Dan Artuso, MVP, but i am stumped. Thank you kindly in advance for any
help, as I am lost on this one.

Previous Posts
Below.......................................................................
............................................................................
....

HI,
Here's one possibility http://www.mvps.org/access/strings/str0004.htm

HTH
Dan Artuso, MVP


"Sweet" <sweet@sweet> wrote in message news:e7WqUG5ICHA.2552@tkmsftngp11...
>
> Hi Duane Hope U R out there today.
>
> Ive discovered that the replace function is not available in Acc 97.
> Otherwise your suggestion would of worked wonders. Any other ideas?
Anybody?
>
> Previous Post Below
>
____________________________________________________________________________
>
> Depending on your version of Access, you should be able to display your
> records using the Replace() function.
> This might work:
> Replace([FieldName],Chr(13)," ")
> depending on the actual character used in the memo field. If you get an
> error message about the Replace function not being available or something
to
> that effect, you may need to create your own function that "wraps" the
> replace() function.
>
>
>
> Function MyReplace(pstrText as String, pstrFind as String, pstrShow as
> String) as String
> 'caution air (error) coding
> MyReplace = Replace(pstrText, pstrFind, pstrShow)
> End Function
>
> --
> Duane Hookom
> Microsoft Access MVP
> Please direct any questions to News Groups
>
>
> "Sweet" <sweet@sweet> wrote in message
news:ubivhWtICHA.1696@tkmsftngp09...
> > Sorry, I should have been clearer. Yes I am just linking into the dbf
> files.
> > The problem memo field in the dbf file has many carriage returns (CR) in
> it,
> > and I just need to display the data and not the CR. I dont want to
display
> > the CR, but simply to make one single line of text, but the problem is
> that
> > when I display it in a query, access instead of displaying it in one
line,
> > puts the lines of data of top of each other. Very frustrating . Thank
you
> > again :-)
>
>


Ken Head

unread,
Jul 12, 2002, 5:44:59 PM7/12/02
to

John Vinson

unread,
Jul 12, 2002, 8:09:23 PM7/12/02
to
On Fri, 12 Jul 2002 22:14:05 +0100, "Sweet" <sweet@sweet> wrote:

>Hi,
>
>I need to replace a carriage return in a query with a space. I am told that
>chr(13) is a CR, but is there somewhere on the web anyone knows where I can
>get a full list of character codes?.
>
>The problem I have is that when I run code to replace a CR using chr(13)
>(Acc97), I get a square box as a replacement instead? I used the code from
>http://www.mvps.org/access/strings/str0004.htm which was kindly recommended
>by Dan Artuso, MVP, but i am stumped. Thank you kindly in advance for any
>help, as I am lost on this one.

A "new line" is coded in Access by TWO characters - Chr(13) followed
by Chr(10). You must have both. If you're doing the replacement in VBA
there is a defined constant vbCrLf; in an Update query use

Chr(13) & Chr(10)


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public

Calvin Smith

unread,
Jul 13, 2002, 1:42:15 PM7/13/02
to
...and to answer the other question, you can find the "ASCII character set"
in online help.

--
Calvin Smith
http://www.CalvinSmithSoftware.com
"Real-world Source Code Solutions"

Mass Emailer - http://www.CalvinSmithSoftware.com/MassEmailer.htm

VB/VBA Tools - http://www.CalvinSmithSoftware.com/AllComboDeals.htm


"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:grruiu0gphchmbjum...@4ax.com...

0 new messages