sending data to multiple people


J

Jean-Paul

Hi,
Another question...

I have this reports I have to send to different people.

I created a listbox with 2 fields:
Field1 containing the name of the person
Fiedl2 containing the email-adress

I also created an entryfield to finally import this in the "sendobject"
command.

I thought I had to write in the OnClick property something like:
Me!Aan = Me!Aan + Me!Personeelslijst

Personeelslijst is the listbox name
Aan is the field on the form

But when I click a name in the listbox... nothing happens in the
entrtyfield...

What code to use?

And also...
What should I put between 2 e-mail adresses so I can past it in the
sendobject command.

Thanks a lot
JP
 
Ad

Advertisements

A

Arvin Meyer [MVP]

The first column of a listbox can be referred to like:

Me.Personeelslijst.Column(0)

The second column would be:

Me.Personeelslijst.Column(1)

and so on. SendObject recognizes the email address only in the To field, but
you can put the person's name in the body of the message.

A semi-colon ; is used to separate email addresses.
 
J

Jean-Paul

OK... this I understand but,

When I click a name in a listbox it should appear in the entryfield
which I fianlly will use in the sendObject command.

exapmle:
I have a listbox with Arvin, John, Mary, Daisy

I click John,
John is put in the field
automatically a ; is placed behind the name
then I click Daisy
Daisy appears in the field

So fianlly I get
[email protected]; [email protected]

What command do I need in the listbox
How to get it in the field
What for the last name because, normally I would have something like
[email protected]; [email protected];
Where the last ; is too much

Thanks
 
J

Jean-Paul

Great... I was able to impliment your form into mine.
I added a pushbutton to clear all email adresses in txtSelected
I wrote:
Private Sub Knop16_Click()
Me!txtSelected = ""
End Sub
However,
The names in the listbox remains selected...
How to clear this selection and get a clean listbox?

Thanks
 
A

Arvin Meyer [MVP]

Just reset the rowsource

Private Sub cmdClear_Click()

Me.lstMailTo.RowSource = "SELECT Email, State, Senator FROM tblSenate WHERE
(Email) Is Not Null;"

Me.txtSelected = ""

End Sub
 
Ad

Advertisements

J

Jean-Paul

perfect... I'll try things out...

Maybe, a last question....

In your porgram, I finally get a group of emails...
Suppose I want, at the same time, a group of names too.
Is that possible?

Now I get (e-mail address removed), (e-mail address removed), (e-mail address removed)
when I click a name but can I get
john, mary, dave, mike
At the same time?
(I doubt it because the depending row is the row with the emails)

Thanks again
 
A

Arvin Meyer [MVP]

The code can be altered to give a group of names, separately as well, but
they won't resolve in your email client. As a result, the first name not
recognized will throw an error that will stop the email from working. If
you've noticed in my code, I was careful to makes sure that there was an
email address, because that too will stop the code if it is missing. Your
data entry, must ensure that the email addresses are well-formed or you will
still get errors and bounced emails.
 
J

Jean-Paul

Maybe I sould explain better...
The idea is to create a group of names and to put that in the BODY of
the message so I can add a line:

This mail has been send to:
john, Mary, Cindy, Carl...

With an mail-adress you not always know the persons name...
 
J

Jean-Paul

this may sound realy dumb...
Where should I look? in the property of the listbox?
I can not find the line:
If Not IsNull(varMsg) Then

Can you please clearify a bit?
Thank you soo much
 
Ad

Advertisements


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