Hello,
I'm trying to create a form that works as a Switchboard to open a number of databases from one place. I want users to be able to click a button and open an existing database in a new window. I tried the following code and the database flashes open and then disappears (fyi - I'm using Access 2007). Any ideas?
I'm trying to create a form that works as a Switchboard to open a number of databases from one place. I want users to be able to click a button and open an existing database in a new window. I tried the following code and the database flashes open and then disappears (fyi - I'm using Access 2007). Any ideas?
Code:
Private Sub Command0_Click()
Dim appAccess As Access.Application
Dim strDB As String
strDB = Me.PMTCTPath 'references text box with file path on form
Set appAccess = _
CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB
End Sub
Comment