Results 1 to 12 of 12
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    DoCmd.OutputTo acOutputReport

    How come I'm prompted to specify the output file type when the following code is executed?

    DoCmd.OutputTo acOutputReport, "PDF-DirNames", acFormatPDF, IPPath & "\PDF-DirNames.PDF", True



    It might be that the code is compiled into an A2003 mde file but executed in an A2007 environment?

    Thanks,
    Bill

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I shouldn't think that would matter. Has 2007 been updated with all the service packs? The first versions out did not include PDF capability. I think it was added in one of the service packs, or could be added via this:

    http://www.microsoft.com/en-us/downl...s.aspx?id=9943
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Paul,
    After downloading and installing from the link you provided, I still get the prompt to specify the output file type.
    Bill

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Curious. Is it a database you can attach here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    The frontend is about 9MB and the backend is only about 2MB, but the required auxilary files, image library, etc. are huge.
    Are there any screenshots that would be useful?
    Bill

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I'm kind of stumped, because I'd think that would work. I happen to be adding email functionality to a client's home-built database (mentioned because of the report name that I would never have created), and this works fine:

    DoCmd.OutputTo acOutputReport, "rpt_customer_invoice_weekly", acFormatPDF, "C:\intacc\" & strFileName & ".pdf"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    "works fine" meaning your client doesn't have to respond to a "specify file-type" dialog when the statement fires?
    Bill

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No, they click a button and x emails get created with client-specific PDF files attached to each. They review and click send. No response to file-type required.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Maybe some insight here, in that the DoCmd.OutputTo acOutputReport works without the "file-type" prompt when the code runs using the mdb of the front-end AND the mde IF the mde is created by A2007. The only difference I can see is the Reference libraries are 12.0 versions rather than 11.0 when the mde is created on the A2003 system. Is it possible to install the 12.0 library versions from Microsoft on my A2003 system? Certainly, I can't be putting the mdb source file on the client machines as a general arrangement.
    Bill

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I guess it makes sense, since the PDF option wasn't valid in 2003. Perhaps when 2003 tries to compile it into an mde, it doesn't put the correct thing there. Presuming it will only be run on 2007 machines, is it an option to create the mde with 2007? Failing that, constants like acFormatPDF typically have numeric equivalents. 2003 doesn't know what it is, so may be leaving it out when it compiles it. You might try finding out what the numeric value is in 2007 and use that instead. I'm on an iPad with no access to Access right now.

    I suppose I'm lucky because I have virtual machines with various combinations of Windows and Office/Access, so I can develop in the environment appropriate to the user. Typically I develop using the "lowest common denominator".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I had that thought earlier today when I was out fishing Gold Lake. Turns out it's a string, not a numeric integer. When acFormatPDF is replace thus: DoCmd.OutputTo acOutputReport, "PDF-DirNames", "PDF Format (*.pdf)", IPPath & "\PDF-DirNames.PDF", True The pdf file is created and saved without the file-type prompt. YEAH! Problem solved. (If one enters an expression like "? acFormatPDF" in the immediate window, Access will reveal the string value.)

    Thanks Paul for all your helpful thoughts.
    Bill

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Interesting. I'm back at a PC, and ALL of the other constants are numeric except the format constants ("Constants Enumeration" in 2007 help if you're interested). Good call on using the Immediate window too.

    Hope the fishing was good! I'm sitting down to Italian sausage, peppers and onions and a nice bottle of Cabernet.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd.OutputTo question
    By mkc80 in forum Access
    Replies: 5
    Last Post: 10-16-2012, 07:11 PM
  2. DoCmd.OutputTo
    By tylerg11 in forum Reports
    Replies: 2
    Last Post: 08-09-2012, 12:22 PM
  3. DoCmd.OutputTo not working
    By arunkumar213 in forum Access
    Replies: 1
    Last Post: 09-08-2011, 10:41 PM
  4. AcFormat in DoCmd.OutputTo
    By SIGMA248 in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 08:50 AM
  5. OutputTo PDF???
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 03-17-2011, 11:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums