Stripping off a little rectangle that separates names in a fie;d

B

bird lover

Syntax help requested. Field [addressee] frequently has two or three names
separated by a little rectangle. The character is not on a standard keyboard.
When I merge [addressee] to Word to print envelopes, it comes out like

John Smith
Mary Smith
Eric Jones

a. In access or word, I want to strip off the second or third or extra
names and put the cleaned date in field [singlename]. I use access 2003 and
2000. Any help would be appreciated.
b. It not too complicated, when the last name is different, can I just
strip off the name with the same surname as the first and leave the third
there.
 
K

KARL DEWEY

First you need to determine what the character is. Use
Right(Left([Addressee], x),1) to isolate it. Then use
Asc(Right(Left([Addressee], x),1)) to find it's ASCII code. 'x' is the
position form the left of the rectangle.
Next use Left([Addressee], InStr([Addressee], Chr(x)-1) to output the first
name. 'x' is the ASCII value determined above.
 

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