Results 1 to 4 of 4
  1. #1
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185

    Question Report not opening, just printing.

    here is the code that came from the wizard on a button function to open a report...



    Code:
    Private Sub OpensLayoutQueryRpt_Click()
    On Error GoTo Err_OpensLayoutQueryRpt_Click
        Dim stDocName As String
        stDocName = "LayoutQuery"
        DoCmd.OpenReport stDocName, acViewReport
    Exit_OpensLayoutQueryRpt_Click:
        Exit Sub
    Err_OpensLayoutQueryRpt_Click:
        MsgBox Err.Description
        Resume Exit_OpensLayoutQueryRpt_Click
     
    End Sub
    In 2010 it opens just fine. In 2003 it just prints out. What change do I need to make here for it to just open in 2003 rather than immediately print it?

    Im sure it has something to do with acViewReport but I cant think of the term.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    change:
    Code:
    acViewReport
    to:
    Code:
    acViewPreview

  3. #3
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185
    Figured it out. I was right...should be acViewPreview, not acViewReport.

  4. #4
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185
    LOL thanks anyway. Looks like we posted at about the same time.

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

Similar Threads

  1. Printing Blank Report
    By andrewm in forum Reports
    Replies: 2
    Last Post: 11-24-2010, 05:30 PM
  2. Opening a report
    By mwabbe in forum Access
    Replies: 3
    Last Post: 09-17-2010, 09:19 AM
  3. Custom Report Printing
    By robocopfl in forum Reports
    Replies: 3
    Last Post: 06-04-2010, 12:23 PM
  4. Report Printing
    By newtoAccess in forum Reports
    Replies: 5
    Last Post: 12-02-2009, 07:46 PM
  5. Replies: 3
    Last Post: 10-19-2009, 01:14 PM

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