• PDF files from Access 97

    Author
    Topic
    #356326

    I have an Access 97 database that records details of electical distribution boards and their associated circuits. There are about 700 Distribution Boards.
    An Access report formats the details of a selected Distribution Board. I want to create hyperlinks from other applications to this report for a particular Distribution Board. EG via a hotspot on an electrical drawing. The other applications only support hyperlinks to files (not

    Viewing 0 reply threads
    Author
    Replies
    • #527221

      Actually I just finished doing this. I do not know that this is the most elegant method, but it works. I use VB to Rename the report using the statement:

      Name OldName as NewName

      OldName is the (full path)name the report was given and NewName is a (full path)name that I build in VB, before this statement, which makes sense to the users.

      This may be all you need, but if you would like me to post more complete code, let me know.

      • #640933

        Thomas,
        Could you post more specific code?

        • #640938

          Thomas’ reply is from more than a year and a half old; he hasn’t been active in the Lounge recently.

          You have to find out what the “default” name Access gives to the PDF file exported from the report, as well as the location (drive/folder).

          You have to decide on the name (and possibly location) you want the PDF file to have.

          Say the exported PDF file is C:MyDatabasesrptTest.pdf and you want to name it QuarterlyReport.pdf in the same folder. Then you would use

          Name “C:MyDatabasesrptTest.pdf” As “QuarterlyReport.pdf”

          If you want to name it QuarterlyReport.pdf and store it in C:ManagementReports2002, you would use:

          Name “C:MyDatabasesrptTest.pdf” As “C:ManagementReports2002QuarterlyReport.pdf”

          Note: you can’t use the Name instruction to move a file to another drive: if you want to do that, use FileCopy to copy the file to a folder on another drive, then Kill to delete the source file.

          If you need more instructions, please provide enough details for others to understand what you want to accomplish.

          • #640943

            Hans,
            Thanks for the reply. I saw the date of Thomas’s post after I’d already sent mine, but figured it was worth a shot. Your post cleared it up somewhat, but I’m still a little confused. Here’s my situation.

            I have several reports in my db that need to go to corporate each month. Currently, the user just prints them from Access (97 SR2) and faxes them, but it’s getting to be too much paper. I tried exporting to snapshot and sending via e-mail, but these reports have graphs in them and snapshot doesn’t like them. So I downloaded a program called PDF2Mail which uses GhostScript and RedMon to generate a PDF file. I don’t know how to change the name of the pdf file created so that the user doesn’t have to go through the process of renaming each file (there are about 6). I’d like to be able to generate the pdf file name based on parameters that are entered to generate the report.

            • #640948

              As Thomas noted, the name of the PDF file is generated automatically, based on the caption of the report. If the Caption property is empty, you’ll get a default name; otherwise, the Caption will be used in the file name. It’s no use to set the Caption property in code, so the best you can do is generate the PDF file and then rename it using Name … As …. like Thomas suggested – my previous reply gives two examples of doing that with fixed new names, but you can construct the new names in code. If you let the user enter or select the parameters on a form, it’s easy to use them in constructing the new file name. Something like

              Dim strName As String
              strName = “Report for Division ” & Forms!frmParameterForm!txtDivision & “.pdf”
              Name “C:MyDatabasesrptTest.pdf” As strName

            • #640989

              You said:
              <>
              I have used this technique before to send reports via email.
              What I have done is to open a report in PREVIEW mode and in the OnOpen event of the report I setup the Caption of the report. After the DoCmd.OpenReport command I issued the SendObject of the report to send the email. Granted this was sent in RTF format but it did send the report as the name that was setup by the caption.
              Pat smile

            • #641227

              Opening the report in Preview mode first is a good idea!

    Viewing 0 reply threads
    Reply To: PDF files from Access 97

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: