J
J.Bennett
I have a database that has three different forms. To navigate from one form
to the other and keep the same record, I have an [Event Procedure] set up.
Additionally, to print the report for the one recored, I have another [Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:
Private Sub printallpages_Click()
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub
I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.
I can simply do the "Preview Report" with the one item, then use the option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....
I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.
Any help would be greatly appreciated.
James Bennett
to the other and keep the same record, I have an [Event Procedure] set up.
Additionally, to print the report for the one recored, I have another [Event
Procedure] that filters the report to the record that is displayed. The
procedure is as follows:
Private Sub printallpages_Click()
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[CUSTID] = " & Me.[CUSTID]
DoCmd.OpenReport "PrintAllOrderForms", acViewPreview, , strWhere
End If
End Sub
I would like to be able to send this same report (with only the current
record) as a pdf attachement to an email address. I would like to be able to
specifiy the specific email address (it will always be sent to the same
address with the same subject). I have found the DoCmd SendObject, but I
have not been able to filter it down to one record.
I can simply do the "Preview Report" with the one item, then use the option
to send as an email attachment. However, the user must put in the email
addresses, subject, etc. Too much user input.....
I have tried the embedded macro, but get the exact same results as the
SendObject as I cannot find a way to filter the report to the one record.
Any help would be greatly appreciated.
James Bennett