remove vbcrf,whitespace at a particular spot.

G

Guest

I am having difficulty extracting the memo fields of a frontpage form that is
emailed to me into access. I believe if I can remove all of the vbCrLf after
the single items(firstname:,lastname: etc - these extract fine)and then have
them replaced right before the field name, it may work. For example my
current email comes like this:

Firstname: john
Lastname: hancock
etc.... now here is memo fields always 2 vbcrlf below

memofield1

data from memofield one This contains chr(13), chr(10)

memoadditional1

info for memoadditional1
more data
for this field.

I would like to use the replace or trim command AFTER lastname to get rid of
all the vbcrlf and then insert one right before field name (memoadditional1:
now becomes vbcrlf memoadditional1:) that way when I extract my data all I
have to do is look for next vbcrlf.
Any help would be greatly appreciated or if you know of better routine to
get this data would be great!
Thanks,
Jack
 
G

Guest

Hello Jack:
I am not sure I understand but the way I am reading this you want to keep
the vbCrLf after firstname, lastname... (where there is just one at a time)
and you want to replace all the "doubles" with a single vbCrLf: If so that
is pretty easy:

NewStr = Replace(OldStr,vbCrLf & vbCrLf, vbCrLf)
That will turn any "double" into a "single" vbCrLf

If you also need to get rid of the CHR(13)CHR(10) then
NewStr = Replace(Replace(OldStr,vbCrLf & vbCrLf,vbCrLf),Chr(13) & Chr(10),"")
This takes the result of the first part and turns the CHR(13)(10) combo into
a "nothing"

I hope this does it.
K Dales
 
B

Brendan Reynolds

? vbCrLf = Chr$(13) & Chr$(10)
True

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
D

Douglas J. Steele

vbCrLf = Chr(13) & Chr(10), so I'm not really sure what you're trying to do
at the end of your post.
 

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