Here is an example from my database that pulls a report with some data and
sends an email with some of the more important fields in the email...
Private Sub Send_Email_Click()
Dim msg
If (IsNull([Reference])) Then
msg = "Please select a record before creating the email."
MsgBox (msg)
'If no record selected, stop procedure
Exit Sub
End If
Dim varSubject As String
Dim varText As String
Dim varDocName As String
Dim varRep As String
varRep = [UserID]
varSubject = "Client: " & [Client_] & " - " & Left([ClientName], 15) & "
Ref: " & [Reference] & " Assignment: " & [Assignment] & " - " & [Type] & "
Rep: " & varRep
varText = "The following Assignment has been made:" & Chr(10) &
"Assigned Rep: " & varRep & Chr(10) & "Ref: " & [Reference] & Chr(10) &
[Client_] & " - " & [ClientName] & Chr(10) & [Assignment] & " " & [Type]
If [Assignment] Like "CONS*" Then
varDocName = "Misc - Consulting Schedule Notification"
Else: varDocName = "Misc - Install Schedule Notification"
End If
DoCmd.OpenReport varDocName, acViewPreview, "", "" ' Open the Report
DoCmd.SendObject acSendReport, , "Snapshot Format", , , , varSubject,
varText, True
DoCmd.Close
Exit_Send_Email_Click:
Exit Sub
End Sub
Does anyone know of any way that I could have an option to
send an email from a form that contains the forms data?
Thanks,
Brook