using send object to send a specific record in a report

B

Barry Phillips

I have a report which I would like to send an indivual record to a recepiant.
I have the code below which takes the email address from the Form and inputs
it in the To field. The problem I am having is this the report with every
record shown (several pages) I want to send the report for only the ID
(primary key) on the open form. Below is the code I am currently using to
send the report.

Any help with this would be greatly appreciated.

Dim strEmail As String


If Me.Dirty Then 'save any edits
Me.Dirty = False
End If

If Me.NewRecord Then
MsgBox "Select a record to view."
Else
strEmail = "" & Me.
DoCmd.SendObject ([acSendReport]), "rpt call in dealer lead",
acFormatRTF, strEmail, , , "Dealer Interest Questionnaire", "Please complete
the attached word document and return by email to [email protected] or fax to
(xxx)111-5555.", True



Exit_Command51_Click:
Exit Sub

Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click

End If
 
Top