i have a simple report, (invoice) that i want to email.
the problem is that it takes very long to make the pdf file
this statement
DoCmd.OutputTo acOutputReport, naamrapport, acFormatPDF, bestand
takes very long.
who has any idea ?
DoCmd.OutputTo acOutputReport acFormatPDF
-
- NewLounger
- Posts: 2
- Joined: 14 Mar 2021, 13:09
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DoCmd.OutputTo acOutputReport acFormatPDF
Welcome to Eileen's Lounge!
The time it takes to save a report as PDF will depend on the complexity of the report and its record source, and on the speed of your computer. So it's difficult to offer specific suggestions.
Does it work better if you create the email message directly?
The time it takes to save a report as PDF will depend on the complexity of the report and its record source, and on the speed of your computer. So it's difficult to offer specific suggestions.
Does it work better if you create the email message directly?
Code: Select all
DoCmd.SendObject ObjectType:=acSendReport, ObjectName:=naamreport, OutputFormat:=acFormatPDF, _
To:="someone@somewhere.be", Subject:="Invoice", MessageText:="Please see the attached invoice", EditMessage:=True
Best wishes,
Hans
Hans
-
- NewLounger
- Posts: 2
- Joined: 14 Mar 2021, 13:09
Re: DoCmd.OutputTo acOutputReport acFormatPDF
the problem is that i can not filter this way, can i ?
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DoCmd.OutputTo acOutputReport acFormatPDF
If you want to filter the report, you can open it in print preview with a filter, then email the active report by omitting the ObjectName argument.
Code: Select all
DCmd.OpenReport ReportName:=naamreport, View:=acViewPreview, WhereCondition:="..."
DoCmd.SendObject ObjectType:=acSendReport, OutputFormat:=acFormatPDF, _
To:="someone@somewhere.be", Subject:="Invoice", MessageText:="Please see the attached invoice", EditMessage:=True
Best wishes,
Hans
Hans