Hi Evereyone,
I’m looking for some help and I’m sure to find it here ;o)
I’ve created in access a simple database to obtain reports. Via a combobox I select a customer number, click on a button and the specific report appears.
I’m able to save manually each report to a pdf file and give it a name, but I want it to be
automatically done. The most important is that filename must be “customer name” and “code” appearing on the report.
I’ve found some solutions but not working in practice.
My DB is composed of:
- A query named “QryHyperi on” based on 2 excell files
o Fields composing the DB:
- A report named “ RptHyperion”
- A form named “form1” with a combobox named “combo8”
Actual used syntax:
File must be saved as “Name” & “Hyperion” .pdf
So how do I have to link both fields to be used as filename when saving?
Thanks in advance for helping me
I’m looking for some help and I’m sure to find it here ;o)
I’ve created in access a simple database to obtain reports. Via a combobox I select a customer number, click on a button and the specific report appears.
I’m able to save manually each report to a pdf file and give it a name, but I want it to be
automatically done. The most important is that filename must be “customer name” and “code” appearing on the report.
I’ve found some solutions but not working in practice.
My DB is composed of:
- A query named “QryHyperi on” based on 2 excell files
o Fields composing the DB:
- Hyperion
- Name
- SAP
- Some others(not important to be mentioned)
- A report named “ RptHyperion”
- A form named “form1” with a combobox named “combo8”
Actual used syntax:
Code:
Dim myPath As String Dim strReportName As String DoCmd.OpenReport "RptHyperion", acViewPreview, , "[SAP]=" & Me![Combo8], acWindowNormal myPath = "S:\Accounts\Reconciliations\Recon letters\" [B][I]strReportName = [Name] + "-" + [Hypérion] + ".pdf" [/I][/B] (this line causes me trouble) DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath + strReportName, True DoCmd.Close acReport, "RptHyperion"
So how do I have to link both fields to be used as filename when saving?
Thanks in advance for helping me
Comment