Open other Access Applications

D

Don

I use over twenty Access Databases on a regular basis. I'd like to create a
new database in which I'd create a form with buttons that would allow me to
open these twenty some databases that I use.

Can someone help me with the syntax of how to program a button to open
another Access database? Thanks.
 
C

Clifford Bass

Hi Don,

Use something like this if in the current directory:

Shell "MSAccess.exe """ & CurrentProject.Path & "\Other Database 1.mdb""",
vbNormalFocus

Or if in some other random directory:

Shell "MSAccess.exe ""X:\Some Dir\Sub Dir\Other Database 2.mdb""",
vbNormalFocus

Clifford Bass
 
P

Piet Linden

Hi Don,

     Use something like this if in the current directory:

Shell "MSAccess.exe """ & CurrentProject.Path & "\Other Database 1.mdb""",
vbNormalFocus

     Or if in some other random directory:

Shell "MSAccess.exe ""X:\Some Dir\Sub Dir\Other Database 2.mdb""",
vbNormalFocus

                Clifford Bass

hmm... I'd put the databases in a table (with the absolute path) and
then just use a combobox and maybe a button... I'm just too lazy to go
about changing designs whenever I add records...
 
C

Clifford Bass

Hi Piet,

Good point about a table! Maybe just make them hyperlinks? And/or
display in a continuous or datasheet form? I have not tried it so I don't
know if it would try to open them in the current instance or a different
instance. Relative paths would allow the relocating of the system without
hassle.

Clifford Bass
 
D

Douglas J. Steele

Just to confuse things, what happens if the user has more than one version
of Access installed? Simply referring to msaccess.exe will launch the most
recently used version, which may not always be correct.

You may want to store version information in the table as well, or look into
some of the 3rd party database launchers that will pick the correct version
for you.
 
C

Clifford Bass

Hi Doug,

If you want to use the current version you are running you can use the
Application.SysCmd method with acSysCmdAccessDir:

Shell SysCmd(acSysCmdAccessDir) & "MSAccess.exe ""X:\Some Dir\Sub Dir\Other
Database 2.mdb""", vbNormalFocus

Clifford Bass
 
D

Douglas J. Steele

Yes, but that assumes that all of the external databases are the same
version as you're currently using.

That's not always the case...
 

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