Help open the Report and save it in PDF format (2 Viewers)

GaDauBac

Member
Local time
Tomorrow, 05:03
Joined
Mar 22, 2021
Messages
41
I have 1 database:
- I want to open a Report and need it to display in PDF format, and save it in PDF format with a common path with the database file.
Please guide and help. Attached is my database file.
Thank you so much everyone!
 

Attachments

  • open_export_pdf.accdb
    3.3 MB · Views: 32

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:03
Joined
May 7, 2009
Messages
13,775
check the code of your button.
 

Attachments

  • open_export_pdf.accdb
    3.3 MB · Views: 75

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:03
Joined
Feb 28, 2001
Messages
20,665
This command is what I use to make a PDF out of a report.

Code:
        tK2 = sgDBDevFld & "Family_List_" & tK1 & ".PDF"
...
        DoCmd.OutputTo acOutputReport, "FamilyList", acFormatPDF, tK2

The "FamilyList" is the name of the report object. tK2 is the name of the PDF output file (as you can see, including .PDF as the file type.) tK1, which is used to define tK2, is a person's name with spaces removed because this was a genealogy project. sqDBDevFld is a device/path specification, which in your case could contain your DB path. (In my case, it actually didn't, but my needs and yours are different.)

The part about opening the report IN PDF is trickier because the report is an Access report. So to do that, you have to actually create the .PDF first and then open the file via a hyperlink.
 

GaDauBac

Member
Local time
Tomorrow, 05:03
Joined
Mar 22, 2021
Messages
41
check the code of your button.
Thank you very much for your help with great understanding!
- I want that the name of the PDF file will be:
"SoHD" & "/HD-QCNB-" & "dd,MM,yyyy" & "hh,mm".PDF
Example: 0006/HD-QCNB/07062001-1608.PDF
- The folder where the file is saved also opens automatically.
Thank you!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:03
Joined
May 7, 2009
Messages
13,775
you can't use "/" and "," in your filename.
 

Attachments

  • open_export_pdf.accdb
    3.3 MB · Views: 120

GaDauBac

Member
Local time
Tomorrow, 05:03
Joined
Mar 22, 2021
Messages
41
you can't use "/" and "," in your filename.
Sorry I bothered you again
I want it to save to "HDkiemPXK" folder but do many times without success. Can you help me again?
Thank you.
 

Attachments

  • HD_PXK.zip
    116.1 KB · Views: 108

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:03
Joined
May 7, 2009
Messages
13,775
test this one
 

Attachments

  • HD_PXK.zip
    402.6 KB · Views: 127

Users who are viewing this thread

Top Bottom