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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send reports from multiple database from one database

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have four databases and email reports from each one of them utilizing command buttons and code. My question is: Can I be in one database and send reports from another database? I hope that makes sense.
 
You can open another mdb as an application and run reports, but it can get messy, depending on the start up.

Code:
Sub DisplayExternalReport()
Dim strDB
Dim appAccess As Access.Application
    ' 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.
    'The next code line can easily be changed to
   'appAccess.DoCmd.OpenForm "frmForm"
   'You can even add a Where statement.
    appAccess.DoCmd.OpenReport "rptReport", acViewPreview
    appAccess.Visible = True
    appAccess.UserControl = True
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top