I am using the following which is called in a cmdBtn sub
Private Sub SendEmail()
On Error GoTo Err_SendEmail
Dim strEmail1 As String
Dim strMailSubject As String
Dim strMsg As String
Dim strDoc As String
strDoc = "Flight_Summary_for_Flight_" & FlightID.Value
strEmail1 = "xxx@xxx.xxx" & vbNullString
strMailSubject = "Flight Summary for Flight " & FlightID.Value
strMsg = "I am attaching the latest Flight Summary Report."
DoCmd.Rename strDoc, acReport, "rptForEmail"
DoCmd.SendObject acSendReport, "Flight_Summary_for_Flight_" &
FlightID.Value, acFormatSNP, strEmail1, , , strMailSubject, strMsg,
True
DoCmd.Rename "rptForEmail", acReport, strDoc
Exit_SendEmail:
Exit Sub
Err_SendEmail:
MsgBox Err.Description
Resume Exit_SendEmail
End Sub
This does indeed change the name of the report, but does not change the name
in the email attachment. So I am thinking I need to change the caption, but
can't find the right syntax.
Teach me to fish! Thanks for the help.
Pax, M
Jeff Boyce - 22 Oct 2007 23:03 GMT
Have you looked into the .Caption property? (check Access HELP)
Regards
Jeff Boyce
Microsoft Office/Access MVP
>I am using the following which is called in a cmdBtn sub
> Private Sub SendEmail()
[quoted text clipped - 32 lines]
> Teach me to fish! Thanks for the help.
> Pax, M
m stroup - 23 Oct 2007 17:26 GMT
I had looked there before posting. But, I did go back at your suggestion.
My problem was I was not opening the report before trying to change the
caption. Once that was changed, it worked great. Thanks for making me think!

Signature
Teach me to fish! Thanks for the help.
Pax, M
> Have you looked into the .Caption property? (check Access HELP)
>
[quoted text clipped - 39 lines]
> > Teach me to fish! Thanks for the help.
> > Pax, M