Discussion Locked

Opening Access Database from within Code

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I know that, while I have a database open, I can open another session of Access 2000, open another database, then close the current database and session via VBA code and/or macros.

I need to be able to open one session of Access with one database(A) and then, without closing the current Access session, open another database(B) and close the original one(A).

Basically I am running a menu system of sorts and it would be much smoother if I could keep one Access session open at all times vs. closing and opening the software everytime I change DB's.

Any ideas? I'm writing mosting in VBA.

Thanks.
Tom H.

5 replies

by sl-campbell

Can I assume you are doing this in Access?

Could you not just dim another database object?

If you are trying to close the session that you originally started an continue with code then I do not think that this is possible.
You might want to create a base session with just a code module to do the work and then open the other sessions (Use Shell), but one session of some sort will always need to remain open.

by timfox

Can you not move the functionality from the second DB into the first DB so the second DB doesn't need to be opened?

or just have your menu structure in a separate DB front end altogether? (i think this was Answer 1's approach above)

This discussion is closed to new replies.