Results 1 to 2 of 2
  1. #1
    lrfowler is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Feb 2011
    Posts
    31

    When I open print preview for a form in Access, I get a ............

    When I try to print preview a form in Access 2007, I get run-time error 53 (file not found):

    any ideas??

    with line 258 highlighted (RetVal.......), as below:

    End If

    DoCmd.OpenReport "rptInvoice", acViewPreview, , " tblInvoice.InvoiceNum=" + CStr(tInvoiceNum)
    If IsNull([AttachmentPath]) = False Then
    If Right([AttachmentPath], 4) = ".pdf" Then
    Dim sAcrobatReaderExe As String ' full path to the Acrobat reader executable
    'sAcrobatReaderExe = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
    If Dir("C:\Program Files\Adobe\Reader 8.0\Reader\", vbDirectory) <> "" Then
    sAcrobatReaderExe = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
    Else
    sAcrobatReaderExe = "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
    End If
    RetVal = Shell(sAcrobatReaderExe & " /P " & Chr(34) & [AttachmentPath] & Chr(34), 0)
    Else
    DoCmd.OpenReport "rptAttachFile", acViewPreview, , " InvoiceNum=" + CStr(tInvoiceNum)


    End If

    End If
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    You want to save the report as a pdf then open reader and view it? Why?

    What is RetVal for?

    This is my only use of Shell:
    Shell.Run CurrentProject.Path & "\Update.vbs"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Print Preview Command Button Locks Access
    By DanKoz in forum Access
    Replies: 7
    Last Post: 03-19-2018, 12:34 PM
  2. Form in Print Preview
    By dennisjoven in forum Forms
    Replies: 2
    Last Post: 08-11-2011, 09:19 AM
  3. Preview print on form ???
    By rfhall50 in forum Forms
    Replies: 0
    Last Post: 03-28-2011, 10:16 AM
  4. Form print preview problem
    By kloss1a in forum Forms
    Replies: 3
    Last Post: 01-03-2011, 12:12 AM
  5. why is access db crashing from print preview
    By GeoffPaton in forum Access
    Replies: 2
    Last Post: 12-10-2010, 03:37 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