Help with displaying contains of a memo field

D

Dave

I have a memo field where the user is entering a hard return when entering
his\her data.

When I display this using asp, I do not show any information. If I remove
the return by editing the data it works OK. I have not been able to determine
what character is being placed there. There is no box character being shown.

How do I determine what character is being placed there and how do I
remove\replace it for display purposes?

Thanks
 
J

Jeff Boyce

Dave

One approach might be to step through the string, one character at a time,
displaying the ASCII code for each. This would be more diagnostic, to
figure out what character you'd then be removing...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John W. Vinson/MVP

I have a memo field where the user is entering a hard return when entering
his\her data.

When I display this using asp, I do not show any information. If I remove
the return by editing the data it works OK. I have not been able to determine
what character is being placed there. There is no box character being shown.

How do I determine what character is being placed there and how do I
remove\replace it for display purposes?

Thanks

It's probably (not certainly!) the standard ASCII CR-LF pair - a
carriage return, Chr(13), followed by a linefeed, Chr(10). Not sure
why this should affect ASP, but you can get rid of it by updating the
field to

Replace([fieldname], Chr(13)&Chr(10), " ")

to replace all crlf pairs with a blank.
 
D

Dave

How do I go through each character? Is there a query or macro that allows me
to do this?

This does sound like the correct approach.

Dave
 
J

Jeff Boyce

If John V's suggestion doesn't help (by the way, make a backup BEFORE
modifying the data!), you could write a short procedure that uses the Mid()
function and the For ... Next construction to step through from the
character in position #1 to the character in the last position in the string
(determined by using the Len() function).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Dave

I used both of your ideas.

I stepped through the text field and found multiple Chr(13)s plus a Chr(10),
so I used to kill them on the ASP page:

varMessComm = Replace(rs("MessComment"), Chr(13), " ")
varMessComm = Replace(varMessComm, Chr(13), " ")
varMessComm = Replace(varMessComm, Chr(10), " ")

The variable was in a JS statement. I am not sure why it bothered the
field, but this did fix it.

Thanks to both of you.



John W. Vinson/MVP said:
I have a memo field where the user is entering a hard return when entering
his\her data.

When I display this using asp, I do not show any information. If I remove
the return by editing the data it works OK. I have not been able to determine
what character is being placed there. There is no box character being shown.

How do I determine what character is being placed there and how do I
remove\replace it for display purposes?

Thanks

It's probably (not certainly!) the standard ASCII CR-LF pair - a
carriage return, Chr(13), followed by a linefeed, Chr(10). Not sure
why this should affect ASP, but you can get rid of it by updating the
field to

Replace([fieldname], Chr(13)&Chr(10), " ")

to replace all crlf pairs with a blank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top