I'm using VBA within Access. I've got a module in database 2 which runs when the database 2 is opened. When it has finished the database closes down. What I would like to be able to do is to open database 2 from database 1 to run this module, close database 2 and keep database 1 open. I've tried a new procedure(see code below) and when I step through the procedure it appears to be working but nothing actually happens.
Any ideas?????
Cheers
Private Sub Command0_Click()
Dim dbs As Database
Dim dbImport As Database
Dim strdb As String
Dim wrkJet As Workspace
Set dbs = CurrentDb
Set wrkJet = DBEngine.Workspaces(0)
MsgBox "Opening"
strdb = "G:\reinledg\Midnight\697LPC\LPCCashImport.mdb"
Set dbImport = wrkJet.OpenDatabase(strdb)
End Sub
Any ideas?????
Cheers
Private Sub Command0_Click()
Dim dbs As Database
Dim dbImport As Database
Dim strdb As String
Dim wrkJet As Workspace
Set dbs = CurrentDb
Set wrkJet = DBEngine.Workspaces(0)
MsgBox "Opening"
strdb = "G:\reinledg\Midnight\697LPC\LPCCashImport.mdb"
Set dbImport = wrkJet.OpenDatabase(strdb)
End Sub