How to let the users choose more than one addresse?

  • Thread starter Thread starter Jo Gjessing
  • Start date Start date
J

Jo Gjessing

Hi all,

In a database of mine I have a combo box in which the users can choose an
address to send email to. In many cases, however, the users will wish to
send the same email to more than one addressee. How can I rebuild the combo
box so that the users can choose more than one addressee? Thank you very much
in advance.

Jo
 
2 approaches come to mind.

1- use a multi-select listbox instead

2- in conjunction with the combo box create an 'add to recipient' button and
a hidden textbox. Then set it up that when the user clicks the button it
passes/adds the combo box value to the hidden textbox (with a ; as a
separator between the values) and as such build the To string. Then setup
your email button to use the value in the hidden textbox rather than the
combo box.
 
Instead of a combo-box, which cannot be multi-select, why dont you use 2
listboxes: one with all the available addresses, and another with the
addresses you need to attach to the email. The 1st listbox doesnt even need
to be multi-select, as this will not ease the task of adding multiple
addresses. On the double-click of the 1st listbox, update the rowsource
(table or query) so that the item double-clicked moves over to the other
listbox.

The rowsource could be a table with fields, [Addresses], and [Selected].
Selected can be set to 0 or 1. When the form first opens, run an sql that
sets Selected to 0 for all records. When an item is double-clicked, set
Selected to 1 for that address.

Set the RowSource of the 1st listbox to 'SELECT Addresses FROM Tablex WHERE
[Selected] = 0' and the RowSource of the other listbox to 'SELECT Addresses
FROM Tablex WHERE [Selected] = 1'

Requery each listbox after double-clicking. You can add a little flare by
setting the double-click event of the 2nd listbox to remove items back to the
1st list.

Regards
 
Back
Top