Opening another database probs.

Z

Zedbiker

I want to be able to open other databases used by the company from the front
end of the database I have created. I have done it for 3 of the 4 databases
but the last one has a space in its name i.e. Contact Numbers.mdb.

When I try to run it I get an error message saying : " The command line you
used to start Microsoft Access contains an option that Microsoft Access
doesn't recognise" I have tried putting an underscore in (_) but that doesn't
work either.

Here is the code I use :
stAppName = "msaccess.exe \\server\databases\Contact Numbers.mdb"
Call Shell(stAppName, 1)

Is there a way around this problem?

Many thanks in advance for any suggestions.
 
D

Douglas J. Steele

You need quotes around the path:

stAppName = "msaccess.exe ""\\server\databases\Contact Numbers.mdb"""
 
Z

Zedbiker

Tried your suggestion but it didn't run Access just came up with:
Error : File not found .

I have tried the following

stAppName = "msaccess.exe ""\\server\databases\Contact Numbers.mdb"""
stAppName = "msaccess.exe "\\server\databases\Contact Numbers.mdb""

without success.

Thanks
???
 
O

Ofer Cohen

Try

stAppName = "\\server\databases\Contact Numbers.mdb"
Application.FollowHyperLink stAppName
 
O

Ofer Cohen

Try

stAppName = "\\server\databases\Contact Numbers.mdb"
Application.FollowHyperLink stAppName

Or try
stAppName = "msaccess.exe """ & "\\server\databases\Contact Numbers.mdb" &
""""
Call Shell(stAppName,1)
 

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