Log in

View Full Version : Opening multiple databases



ScriptHam
02-02-2006, 07:17 AM
Hi

I have a print button, cmdPrintRun, on a form, frmPrint1, in db1 which I want to operate from a form, frmPrint2, in a different database, db2. The print button, which does work, prints out a number of reports. I just want to be able to operate it remotely. How do I go about this please.

Is this anything like just to open the second database

Private Sub cmdPrintRun_Click()
On Error GoTo Err_cmdPrintRun_Click

'...To open the database
Dim dbMyDb As Database
Set dbMyDb = DBEngine(0).OpenDatabase("db1.mdb", False, False) ', ";pwd="

db1 and db2 are in the same directory and there is no PWD.
Many thanks
ScriptHam

OBP
02-03-2006, 01:00 PM
I would have thought that the normal way to do this would be to link the second database to the database table/query which holds the report and have a copy of the report in the second database. When you run the report it will pick up the data from the original table.