Results 1 to 4 of 4
  1. #1
    DarrenUD is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    22

    convert report view to print preview


    Hi All,

    I just got in to a another problem with my report and I hope one of you kind people can help me to solve this problem. I have created a access report for a invoice and I have placed few command buttons on the report header like Print to PDF , Print to Invoice and Print Preview. Well, first two buttons working fine and I am stuck with the third button. I want to convert the already open report (in Report view) to print preview. how can I achieve this using VBA. Please Help

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Of course, if the report is already open, it will have to close and be re-opened! DoCmd.Close acReport, Me.Name

    Dim stDocName As String

    stDocName = "YourReportName"

    DoCmd.OpenReport stDocName, acPreview

  3. #3
    DarrenUD is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    22
    Hi Burrina, it worked like a charm. I don't know what went wrong last time, because I have used a similar code and that didn't work. Anyhow thanks again..

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Your Welcome. Glad it worked for you.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-02-2013, 12:44 AM
  2. Replies: 1
    Last Post: 10-20-2011, 01:34 PM
  3. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  4. Replies: 1
    Last Post: 04-21-2011, 01:58 PM
  5. Can't see sub report in print preview
    By LoggyDoggy in forum Access
    Replies: 1
    Last Post: 04-20-2010, 05:38 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