Shell or Hyperlink Is there a way to work around spaces in the file name? (1 Viewer)

PookaTech

Registered User.
Local time
Today, 17:34
Joined
Jun 10, 2003
Messages
53
Hello Everyone,

I am trying to open one database from another.

Both the Shell function and hyperlink fail because the database I am trying to open has spaces in its name. Is there a way to work around the spaces or do I have to change the databases name (It would sort of be a pain).

Also, If you could tell me how to keep an application open when creating an instance of it with createobject that would be great. Right now I can use the create object, but the app always closes after I stop running code on it.

The following examples illustrate the problem. The database to be opened could be called "I like Rabbits"

Call Shell(SysCmd(acSysCmdAccessDir) & "msaccess.exe F:\Pooka\I like Rabbits.mdb"
Application.FollowHyperlink "F:\Pooka\I like Rabbits.mdb"

Thanks to anyone who reads this,
Pookatech
 

Tim K.

Registered User.
Local time
Today, 23:34
Joined
Aug 1, 2002
Messages
242
You can use Chr(34) (") to help, like this.

Call Shell(SysCmd(acSysCmdAccessDir) & "msaccess.exe " & Chr(34) & "F:\Pooka\I like Rabbits.mdb" & Chr(34)

Application.FollowHyperlink Chr(34) & "F:\Pooka\I like Rabbits.mdb" & Chr(34)
 

PookaTech

Registered User.
Local time
Today, 17:34
Joined
Jun 10, 2003
Messages
53
Things are working well. Thanks for the tip!

Pookatech
 

Users who are viewing this thread

Top Bottom