Re: Drag and Drop, then Email

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rob Parker (CUT_THIS)
Date: 03/08/05


Date: Wed, 9 Mar 2005 07:52:38 +1100

You can refer to the email field via the Column property of the listbox.
The index is zero-based, so in your case, to get the email field, you would
use .Column(2).

HTH,

Rob

"Kurt" <Kurt@discussions.microsoft.com> wrote in message
news:3B2E3E78-9DC9-406D-B304-E21970033C1A@microsoft.com...
> I have a drag and drop interface so that the user can select one or more
> names from an unbound list box (List1) and move them to another unbound
list
> box (List2). (They can also drag and drop from List2 to List1.)
>
> Once the user drags some or all names from List1 to List2, I would then
like
> the user to be able to click on a command button which will open Outlook
and
> populate the To: box with the emails of the people in List2.
>
> If I can string together the emails in List2, and then copy this text
string
> into a hidden unbound text box (txtSelected), I'll be in good shape
because I
> can just put this behind the email command button:
>
> Private Sub cmdEmail_Click()
> Dim strEmail As String
> strEmail = Me.txtSelected & vbNullString
>
> DoCmd.SendObject To:=strEmail
> End Sub
>
> I'm just not sure how to extract the email values from List2 and string
them
> together. One potential problem (or maybe not) is that the bound column in
> List2 is *not* the email value. Instead, it's PersonID. This is required
for
> the drag and drop feature to work in both directions.
>
> Here's the rowsource of List2:
>
> SELECT tblPeople.PersonID, tblPeople.LName, tblPeople.Email
> FROM tblPeople
> WHERE (((tblPeople.ysnSelected)=True)
> AND ((tblPeople.Status)="1")
> AND ((tblPeople.DoNotContact)=False))
> ORDER BY tblPeople.LName;
>
> ###
>
> Any ideas? Thank you.
>
> Kurt
>


Quantcast