Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I print an Access report in a VB .NET application?

application print report VB
0
Posted

How can I print an Access report in a VB .NET application?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123