E-Mailing a report that corresponds with the record from form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a command button on a form that e-mails a report as an attachment.
It's currently showing all records. How do I select only the record currently
showing on the form? My report's source is the table, not a query.

Thank you so much! Laurie

Here is my code:

Private Sub E_Mail_Case_Click()
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
On Error GoTo Err_E_Mail_Report_Click

Dim stDocName As String

stDocName = "Inquiry Report"
DoCmd.SendObject acReport, stDocName

Exit_E_Mail_Report_Click:
Exit Sub

Err_E_Mail_Report_Click:
MsgBox Err.Description
Resume Exit_E_Mail_Report_Click

End Sub
 
I would have thought the easy way was tot change the source to a query based
on your table and include parameters to filter the record you want.
Good luck
Tony
 
Thanks for your reply Tony.

So the user would be asked for an input value in a message box? That's fine,
but I'm wondering if there is a more automatic way-- we don't have
sophisticated or patient users, so the simpler and fewer steps, the better.

Laurie
 
Back
Top