Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PDF files from Access 97

    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

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF files from Access 97

    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.

  3. #3
    Lounger
    Join Date
    May 2002
    Location
    Wytheville,VA, Virginia, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF files from Access 97

    Thomas,
    Could you post more specific code?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PDF files from Access 97

    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.

  5. #5
    Lounger
    Join Date
    May 2002
    Location
    Wytheville,VA, Virginia, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PDF files from Access 97

    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.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PDF files from Access 97

    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

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: PDF files from Access 97

    You said:
    <<It's no use to set the Caption property in code>>
    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 <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PDF files from Access 97

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •