Open DB from another DB using shortcut work group

  • Thread starter Thread starter jsccorps
  • Start date Start date
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?
 
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.
 
Back
Top