Dynamic select email address using SendObject



Dear Gurus:

I have a query that has hundreds of records and need to be sent to different
people according one field as the email address in the query. The table has
one fields called EmployeeNum, and the email address is (e-mail address removed).
I use SendObject in Macro to send out attached excel file. The object Name is
a query that uses criteria to ask for employeeNum. Can I use the address
field of the Query A in TO as email address?

If I can't do it in the macro, how can I code it in the module? I will need
to automatically send selected employee with information attached as excel

Thanks for your great help,




Steve Schapel


If you can set things up so that the employee that you want to send to
is the current record on a form, then you can refer to this in the To
argument of the SendObject action, using syntax such as...
=[Forms]![NameOfForm]![EmployeeNum] & "@abc.com"

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