Quotes and Ampersands

V

VBIlliterate

Hello,
I am trying to open a database from my current database, but am having
trouble with the following line:

call Shell(SysCmd(acSysCmdAccessDir) & "msaccess.exe \\serverX\Tools &
Applications\MyApplication\File1.mdb", vbNormalFocus)

First it says "The command line you used to start Microsoft Office Access
contains an opion that Microsoft Office Access doesn't recognize."

And then it opens another instance of access and says "Microsoft Access
can't find the database file '\\serverX\Tools.mdb'

I know that the ampersand in the folder is causing an error but I cannot
change the folder name--is there any way to work around it?

THANK YOU!!!
 
D

Daniel

VBIlliterate

Try this instead

Shell(SysCmd(acSysCmdAccessDir) & "msaccess.exe " & """\\serverX\Tools &
Applications\MyApplication\File1.mdb""", vbNormalFocus)

Daniel
 

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