Open another database

deejay_totoro

Registered User.
Local time
Today, 20:11
Joined
May 29, 2003
Messages
169
Hello all,

I have created a form that I use as a menu screen. The user may click on a button and this opens a form.

I would like to create a button that when clicked, opens another database file. Is this possible?

Thank you!

dj_T
 
Last edited:
Code:
Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe X:\YourDatabase.mdb", vbNormalFocus)
 
Spaces?

Thanks!

I can get it to reference the database - however how can i deal with spaces?

For example:

X:\Folder\My Folder name with spaces\My database name with spaces.mdb

I have no control over the naming convention used - I must work around spaces in the name.

Thanks again!

dj_T
 
Spaces should not matter. My example has a spaces in the directory name and it works.

If you do have a weird problem with the spaces then use the old DOS truncated 8.3 name. Like this...

Code:
Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe X:\Folder\Myfold~1\Mydata~1.mdb
", vbNormalFocus)
 
Not sucessful

Hello,


Unfortunately the line is still not functioning. I tried these examples:

C:\test test\test.mdb is the location of the database

Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe C:\test~1\test.mdb", vbNormalFocus)

and

Call Shell("C:\Program Files\Microsoft Office\Office\msaccess.exe C:\test test\test.mdb", vbNormalFocus)

I did try opening a file in the root directory and a folder with no spaces. In this case it works - it just doesn't seem to like spaces! (even when referencing the file using the old dos style ~1...)

any ideas?

thanks!

dj_T
 
What about...

Call Shell("C:\Progra~1\Micros~1\Office\msaccess.exe C:\testte~1\test.mdb", vbNormalFocus)

The spaces are tricky when using the ~ for you have to skip the space if it is withing the fist six characters of the name. (I think ;-)
 
believe it or not..

Thanks again for your reply.

Believe it or not, it still doesnt work :(

"Path not found..."

any ideas?

Thanks!

dj_T
 

Users who are viewing this thread

Back
Top Bottom