Open Another Database Without Closing Current Db

jaydwest

JayW
Local time
Today, 08:52
Joined
Apr 22, 2003
Messages
340
I use the following lines of code to Close the current DB and open another DB.

DoCmd.Close acForm, Screen.ActiveForm.Name
SendKeys "%FO" & pasPathName & "~", False

I thought it would be fun to be able to open another database in another window without closing the current db.

I'm using Access 2000. Any Suggestions?

Thanks in advance for your help :cool:

Jay West
jwest@oakmountain.com
 
OK, I open another DB, but close the current instance (that's what they wanted) but you might be able to just open a new instance, havn't tried it.
Here is the code anyway, just takes a string of the path and name to DB to open.
Public Sub OpenADatabase(ByVal strPath As String)
On Error Resume Next
Set appAccess = CreateObject("Access.Application")
appAccess.DoCmd.Quit
With appAccess
.OpenCurrentDatabase strPath
.Visible = True
DoEvents
' .Run "OutsideControl", Trim(Str(Flag))
End With
End Sub
 

Users who are viewing this thread

Back
Top Bottom