send a report via email (1 Viewer)

srideout2525

Registered User.
Local time
Today, 04:46
Joined
Mar 4, 2003
Messages
81
This is what I've tried, but i only want to send the invoice that is related to one order...not every invoice in the database. I thought I could use this:

stLinkCriteria = "[tblOrder.OrderID]=" & Me![OrderID]


but there doesn;t seem to be link criteria option with SendObject.
------------------

Private Sub cmdEmailInvoice_Click()
On Error GoTo Err_cmdEmailInvoice_Click

Dim stDocName As String

stDocName = "rptInvoice2"
DoCmd.SendObject acReport, stDocName

Exit_cmdEmailInvoice_Click:
Exit Sub

Err_cmdEmailInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdEmailInvoice_Click

End Sub
 

Opengrave

Registered User.
Local time
Today, 02:46
Joined
Sep 6, 2001
Messages
70
You may need to write a few lines of code in the reports's open event to set the report criteria. I'm not great at this so I'd suggest looking up information on Filter Property in Access or this message board.

There are other (messy) ways of doing with with surgically constructed SQL code to create a report's RecorSource but what you need should be do-able without having to resort to that.
 

Users who are viewing this thread

Top Bottom