>> Open another database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I want to switch to another database. That is, close the current database
and then open another database. The following code doesn't seem to do it...

Set dbsCheck = DBEngine.Workspaces(0).Databases(0)
Set dbsOpen = DBEngine.Workspaces(0).OpenDatabase(strOpen)

dbsCheck.Close


Any ideas or suggestions appreciated :-)

Thanks
Jonathan
 
To fire up the other app, you could use:
Application.FollowHyperlink "C:\MyPath\MyFile.mdb"

If you have multiple versions of Acess installed and want to ensure you end
up using the same one:
Call Shell(SysCmd(acSysCmdAccessDir) & _
"msaccess.exe C:\MyPath\MyFile.mdb", vbNormalFocus)

Then to quit the current application:
DoCmd.Quit

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
 
Back
Top