title: Opening a new DB with VBA
body: <p>I am trying to open another db using VBA from my current db then close the one I am in. When I use the code listed here it opens Access but closes it immediately. I am sure it is simply something I am overlooking but the past hour I have wracked my brain. Any help would be greatly appreciated.</p>
  
  <pre><code>Private Sub Command115_Click()
  Dim objAccess As Access.Application
  
  Const conPATH = "C:\Users\user\Desktop\Database1.accdb"
  
  'Create an instance of the Access application object.
  Set objAccess = CreateObject("Access.Application")
  
  'Open the database
  objAccess.Visible = True
  objAccess.OpenCurrentDatabase conPATH
  
  'Open the form.
  objAccess.DoCmd.OpenForm "Main-Form"
  
  ' Maximize other Access window
  objAccess.DoCmd.RunCommand acCmdAppMaximize
  End Sub
  </code></pre>
  
  <p>Thanks in advance for any help in this matter</p>