send object to multiple users getting complie error with ";"

P

playwriter1

I have a command buttons for reports that emails them to mutliple users. I
set up a table of email addresses. Since I may need to change these from
time to time I have set up a form so users can make those changes themselves.
So, the email addresses in the "to "and "cc " are enters as [EMAIL 1] ;
[EMAIL 2] etc. taking the data from the original table. I thought. But
when I try to save it gives me a compile error expected end of statement
hightlighing the semi-colon. The only way I can get multiple email addresses
to appear is to manually type them in between quotations as it shows in the
example. "name@###.com ; name@###.com". Of course I did something silly and
tried that but of course my email addresses came up as EMAIL 1 and EMAIL 2
not the actual email addresses. Is there a simple work around or something I
can do to make this work?

Thanks.
 
G

Gojavid

I might not understand the issue. I would think you could do...

[Email 1] & "; " & [Email 2]
 
P

playwriter1 via AccessMonster.com

I tried this and it did not work I get the samer error. Here's what I typed
in:

DoCmd.SendObject acSendReport, "REPORT 4", , [Text52] ; [Text54] , , "BRANSON
TV WEEKLY REPORT", "Here is the most recent report. If you have any
questions or concerns please feel free to contact me.", , False

If I put just one of the [Text] in it works, but when I try to put the ; and
the next [Text] it gives me the compile error.
I might not understand the issue. I would think you could do...

[Email 1] & "; " & [Email 2]
 
G

Gojavid

I'm not sure that you've tried what I posted if the code you are
listing is what you have tried thus far. Your code would look like
this:

DoCmd.SendObject acSendReport, "REPORT 4", , [Text52] & " ;" &
[Text54] , , "BRANSON
TV WEEKLY REPORT", "Here is the most recent report. If you have any
questions or concerns please feel free to contact me.", , False

Notice the string inbetween your [text52] and [text54]... "; ",
otherwise it will fail.
 

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