It's been a while since I used this and I'm embarrassed to say I cannot remember how to use it. I'm trying to open another Access DB on a network drive. Thank you.
It's been a while since I used this and I'm embarrassed to say I cannot remember how to use it. I'm trying to open another Access DB on a network drive. Thank you.
Was VBA help not helpful? It would look like:
Call Shell("C:\Programs\...\MSACCESS.EXE \\ServerName\...\FileName.MDE", 1)
If memory serves, you might be able to get away with just the name of the executable, rather than the full path to it. Generally speaking you should have the Access db on the local PC, not a network drive.
couldn't you also use the:method?Code:dbengine.opendatabase
Kinda dropped the ball on this thread! I tried pbaldy's method. Got a runtime '5' error. I'm not familiar with the "dbenginge.opendatabase" method, but I tried the below code...no luck
Code:Dim vAppName As String, vAppLoc As String vAppName = "Database1.mdb" vAppLoc = "C:\Data\" & vAppName DBEngine.OpenDatabase vAppLoc
We would have to see the actual code to know why you got an error. You can also use FollowHyperlink, which doesn't require a path to the executable.
Ended up finding the solution...Thank you Google!
Can anyone explain the need for all those " and spaces?Code:Call Shell("""" & "C:\Program Files\Microsoft Office\OFFICE14\MSACCESS.exe" & """" & " " & """" & vAppLoc & """", vbMaximizedFocus)
The quotes are required due to spaces in the path to the file (I suspect only the file path, not the executable path, because Shell works for me without all the quotes, but I don't have spaces in the file path).