Help open the Report and save it in PDF format (1 Viewer)

GaDauBac

Member
Local time
Tomorrow, 02:04
Joined
Mar 22, 2021
Messages
42
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: 225

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:04
Joined
May 7, 2009
Messages
19,169
check the code of your button.
 

Attachments

  • open_export_pdf.accdb
    3.3 MB · Views: 445

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:04
Joined
Feb 28, 2001
Messages
26,999
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, 02:04
Joined
Mar 22, 2021
Messages
42
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, 03:04
Joined
May 7, 2009
Messages
19,169
you can't use "/" and "," in your filename.
 

Attachments

  • open_export_pdf.accdb
    3.3 MB · Views: 525

GaDauBac

Member
Local time
Tomorrow, 02:04
Joined
Mar 22, 2021
Messages
42
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: 483

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:04
Joined
May 7, 2009
Messages
19,169
test this one
 

Attachments

  • HD_PXK.zip
    402.6 KB · Views: 517

Users who are viewing this thread

Top Bottom