Yes. Here is my code in my form. Strip out what you need...
Private Sub Send_Email_Click()
On Error GoTo Err_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 = IIf(IsNull([UserID]), "*Not Assigned*", [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
Err_Send_Email_Click:
MsgBox Err.Description
Resume Exit_Send_Email_Click
End Sub
I am trying to set up a control button, that when pushed will email a
particular record in a form or table. I know that sendobject will email a
table, form, query or report, but is there any way to isolate a particular
record to send?