email report per record

D

dchristo

I am trying to email a report.

On my form I have a button that the user will click - this will send a
report based on the record shown on the form.

Private Sub Sheet1_Click()
Dim strMessage As String 'Body of message
Dim strSubject As String 'Email Subject
Dim strTo As String 'To address
Dim strCC As String 'CC Address
Dim strBCC As String 'BCC Address
Dim stDocName As String
Dim strWhere As String

strWhere = "[id number] = " & Me.[id Number]
stDocName = "Info Form"
strTo = "(e-mail address removed)"
strCC = ""
strBCC = ""
strSubject = "New request placed - " & Me.[id Number]
strMessage = "If you have any questions, please me at the above email
address."

DoCmd.SendObject acReport, stDocName, acFormatSNP, strTo, , ,
strSubject, strMessage, False

However, it is emailing every single record in the database, how do I send
just the current record that is showing on the form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top