How can I print an Access report in a VB .NET application?
You can use the following routine to print an Access Report in VB .NET Windows application: Sub printAccessReport(ByRef dbname As String, ByRef rptname As String, ByRef view As String, ByRef filterstr As String, ByRef wherestr As String) Dim appAccess As Object Dim iview As Short Try appAccess = CreateObject(“Access.Application”) appAccess.OpenCurrentDatabase(dbname) iview = 0 If (view >= “0” And view <= "9") Then iview = Val(view) appAccess.DoCmd.OpenReport(rptname, iview, filterstr, wherestr) appAccess.DoCmd.Close(Access.AcObjectType.acReport, rptname) appAccess.CloseCurrentDatabase() appAccess = Nothing Catch ex As Exception MessageBox.Show(ex.Message, "printAccessReport") End Try End Sub