>> Open another database

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
 
G

Guest

Allen Browne said:
michka has a TSOON utility (Trigeminal Shut One Open Next) at:
www.trigeminal.com

Thanks Allen for the link. I don't want to seem ungrateful. But, I really
want to have an example of the code for this outcome...

Thanks
Jonathan
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top