Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating an Access Report from within Excel

Status
Not open for further replies.

popper

Programmer
Dec 19, 2002
103
AU
Hi there,

Can anyone tell me how to cause a Microsoft Access report to be printed at the press of a button in Excel?

Would love to know.

With thanks
 
Something on these lines:

Code:
Sub PrintReport()
    ' Initialize string to database path.
    strDB = _
        "C:\Docs\LTD.mdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB
    ' Open report.
    appAccess.DoCmd.OpenReport "rptReport"
    ' Pick one of these lines:
    ' appAccess.Visible = True
    appAccess.Quit
End Sub

 
Thank you very much. I will give this a try.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top