DoCmd Code

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

I'm wanting to insert data, in this case and employee's name from query1,
into the text of an email. Can anyone tell me how this is done. I've
provide some sample code below. Many thanks!

Function SendEmail()

DoCmd.SendObject acSendQuery, "Query1", "HTML", "John Doe", , , "Adherence", _
"The following agent (Query1.[Employee Name]) is out of adherence"

End Function
 
Check out the DLookup function, it may provide the results that you seek.

DoCmd.SendObject acSendQuery, "Query1", "HTML", "John Doe", , , "Adherence",
_
"The following agent (" & DLookup("Employee Name", "Query1") & ") is out of
adherence"
 

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

Back
Top