How to run Macro from item selected in listbox

M

Morné

My company is using GroupWise as the preferred form of e-mailing; therefore I
am unable to perform an e-mail merge via MS-Word.

I have developed an Access database with a simple bounded list box of each
person's e-mail address. Upon clicking on the required e-mail address, an
underlying macro is activated that e-mails a report uniquely to that person.
How can I loop through the list programmatically to have each report e-mailed
separately as if it is an e-mail merge?
 
K

kc-mass

Forget the list box and use the listbox source.

Something in the vein of:
Sub SendAll()
Dim db as Database
Dim rs as Recordset
Set db = CurrentDataBase
Set rs as db.OpenRecordset("theListboxSource")
rs.MoveFirst
Do While not rs.EOF
Do something here to send email to current record email address
rs.MoveNext
Loop
Set rs = Nothing
Set db = Nothing
End Sub

Regards

Kevin
 

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