Hi everybody! Can i print Access Report from vb6 form?Any help is Appreciated!
Sure VB Code: 'Set A Reference To Microsoft Access Object Library Private Sub cmdPrintReport_Click() Set Axs = CreateObject("Access.Application") Axs.OpenCurrentDatabase (DBPath) Axs.DoCmd.OpenReport "MyReport" Set Axs = Nothing Axs.Quit 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.
'Set A Reference To Microsoft Access Object Library Private Sub cmdPrintReport_Click() Set Axs = CreateObject("Access.Application") Axs.OpenCurrentDatabase (DBPath) Axs.DoCmd.OpenReport "MyReport" Set Axs = Nothing Axs.Quit End Sub
Forum Rules