
Open Report in External Database
Hi,
VBA novice here... I've been trying (with no success) to
get this to work. What is the proper code to open up a
report that is located in a different database? So far,
I've got the following:
Private Sub cmdRptClientStat_Click()
Dim db as Database
Set db = DBEngine.Workspaces(0).OpenDatabase
("j:\ClientDB.mdb" _
, , True)
'[Some code goes here to view the report.]
db.Close
Set db = Nothing
End Sub
Do I need to somehow set db as the current database and
then use DoCmd.OpenReport?
Or do I have to re-create the report in the current
database and connect it to the external database? Any help
would be greatly appreciated.
James