How to run Macro from item selected in listbox

  • Thread starter Thread starter Morné
  • Start date Start date
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?
 
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
 
Back
Top