At the moment I am redesigning someone else's personell registration system for work. The idea is that the management of the concerning office will be notified of newly hired employees, renewed contracts and so on through email, which is sent by hitting a particular button. The idea is to put the name of the concerning employee in the subject line. I have managed to get that to work with the following code:
Code:
DoCmd.SendObject acSendReport, "new employee", "PDFFormat(*.pdf)", "someone[@]somewhere.com", "", "", "New employee" & " - " & Forms![form name]![Name] & ", " & Forms![form name]![Initials] & " " & Forms![form name]![Insertion], "Dear colleages, so and so on", True, ""
The only problem is, it sends the wrong name (from the first record). Which brings me to my question: does anyone know how to retrieve and send the name in the current record? I have tried using Me.name etcetera, but that produced an error message. Thanks in advance.