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

How to open report in another database from within a form 2

Status
Not open for further replies.

tontenn

Vendor
Joined
Dec 29, 2006
Messages
54
Location
AU
Hi Guys

Im bacccckkk. Thanks for all your help so far in the past.

I have another dilemma. I have two working well databases. What i would like to do is click on some text or a button in one and then that will open up a report from the other one.

The current database is called CSCSTD and Im in a form called "NewEmployeeKit". If I click on this link i want to open database "CSCContactManagementSystem" and then open report "StaffList"

Is this possible??? or do i need to combine them into one (Which is the least liked option here)

Thanks in advance

Regards
Tones
 
How about:

Code:
Sub DisplayExternalReport()
Dim strDB
Dim appAccess As Access.Application
    ' Initialize string to database path.
    strDB = "C:\Docs\Tek-Tips.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", acViewPreview
    appAccess.Visible = True
    appAccess.UserControl = True
End Sub
 
Thanks remou

Just what the doctor ordered.

Regards
Tones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top