Open DB from another DB using shortcut work group

J

jsccorps

Have a DB with the following shortcut for a secure login:

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
"C:\GoDoers\Executive_Go_Doers.mdb" /WRKGRP "C:\GoDoers\Security.mdw"

I'm not having any luck using the following to open the DB:

Application.FollowHyperlink "c:\GoDoers\Executive_Go_Doers.mdb"

I get the message " run-time error 490 cannot open specified file"

Any ideas?
 
D

Dirk Goldgar

jsccorps said:
Have a DB with the following shortcut for a secure login:

"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
"C:\GoDoers\Executive_Go_Doers.mdb" /WRKGRP "C:\GoDoers\Security.mdw"

I'm not having any luck using the following to open the DB:

Application.FollowHyperlink "c:\GoDoers\Executive_Go_Doers.mdb"

I get the message " run-time error 490 cannot open specified file"

Any ideas?

I think for this you need to use the Shell function, rather than
FollowHyperlink:

Shell """C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE""
""C:\GoDoers\Executive_Go_Doers.mdb"" /WRKGRP ""C:\GoDoers\Security.mdw""",
vbNormalFocus

It's tricky to get all the quotes right, since we need to put quoted strings
into a quoted string. Let me try again, using some constants to make the
argument clearer:

Const Q As String = """"

Const AccessPath As String = _
"C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"

Const DBPath As String = _
"C:\GoDoers\Executive_Go_Doers.mdb"

Const MDWPath As String = _
"C:\GoDoers\Security.mdw"

Shell _
Q & AccessPath & Q & " " & Q & DBPath & Q & _
" /WRKGRP " & Q & MDWPath & Q, _
vbNormalFocus

I'm not promising that's right, but it should be close.
 

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