Aug 17 2005, 02:11 AM
Basically, I'd like to fill out a form's several memo and text fields, save it, click on a button and have the Label and associated information from the text / memo fields put into the body of an email, rather than attaching a report. I'd also like the email's 'To' and 'Subject' information to be automatically filled in.
Aug 17 2005, 02:17 AM
here is some working sample code which should help you further:
Dim strToWhom As String
Dim strMsgBody As String
Dim Fname As String
Dim Lname As String
Fname = Forms!frmQryDueRetest!EmployeFirstName
Lname = Forms!frmQryDueRetest!EmployeLastName
strToWhom = txtemailsupervisor.Value '<-- this is a field that holds an e-mail on the form or just use "firstname.lastname@example.org"
strMsgBody = ("Mr/Ms " + [Lname] + ", " + [Fname] + " is due for tests!" & vbCrLf & "Your next line" & vbCrLf & vbCrLf & "two more lines down with more information in the body or whatever you want...")
DoCmd.SendObject , , , strToWhom, , , "WARNING! Someone is due for tests!", strMsgBody, True