Results 1 to 2 of 2

Thread: Printing Access Report from vb6

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    6

    Printing Access Report from vb6

    Hi everybody!
    Can i print Access Report from vb6 form?Any help is Appreciated!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Printing Access Report from vb6

    Sure
    VB Code:
    1. 'Set A Reference To Microsoft Access Object Library
    2.  
    3. Private Sub cmdPrintReport_Click()
    4.           Set Axs = CreateObject("Access.Application")
    5.            Axs.OpenCurrentDatabase (DBPath)
    6.            Axs.DoCmd.OpenReport "MyReport"
    7.            Set Axs = Nothing
    8.            Axs.Quit
    9. End Sub
    Where "MyReport" is the name of the Access report and DBPath is the path to your database.

    Please note that in order for this to work the machine must have Access installed in addition to your database that contains the report.

Posting Permissions

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



Click Here to Expand Forum to Full Width