Dynamic select email address using SendObject

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
file.

Thanks for your great help,

JC
 
Jackie,

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"
 
Back
Top