I'm trying to find a way to physically switch active databases during run-time. Here's the code I have so far:
Public Sub OpenNewDB()
Const strPath = "C:\Devices.mdb"
Application.CloseCurrentDatabase
Application.OpenCurrentDatabase strPath
End Sub
This code will close the current database just fine, but it doesn't open the other database. I suppose that closing the current database also terminates the running code. Is there any way around this?
Public Sub OpenNewDB()
Const strPath = "C:\Devices.mdb"
Application.CloseCurrentDatabase
Application.OpenCurrentDatabase strPath
End Sub
This code will close the current database just fine, but it doesn't open the other database. I suppose that closing the current database also terminates the running code. Is there any way around this?