Commas in a string of text in VBA

G

Guest

Within an Access database in VBA I have the following statement:

DoCmd.SendObject acSendForm, , acFormatXLS, _
"Doe, John", "Doe, Jane. ; Doe, Jack ; Doe, Jill.; Doe, James", , _
"Molding - Zero Quantities", "There are currently zero spares on
hand for the following items:", True

The problem I am having is that once this bit of code is ran and the e-mail
pops-up with the "Doe" names in their appropriate fields, instead of putting
commas between Doe, John it puts Doe; John. How do I get these semi-colons
to apepar as commas. Thanks in advance.
 
G

Guest

Use the replace function

Replace("Doe, Jane. ; Doe, Jack ; Doe, Jill.; Doe, James", ";", ",", 1)

jmonty
 
P

Pieter Wijnen

Check the string - you have a "," between Doe, John & Doe, Jane.
But more likely that's a typo & the e-mail program expects: John Doe;Jane
Doe
or Maybe even John Doe,Jane Doe
Haven't used mailing-lists with the SendObject (Regional Settings - List
Seperators may play a part)

HTH

Pieter
 

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