Code:
Public Function Toolkits(Letter As String)
Dim stAppname As String, Kit As String
Dim PathName As String
PathName = " C:\AccessSystems\"
Kit = "X"
Select Case Letter
Case "S": Kit = "Stores2000.mde"
Case "E": Kit = "Extrusion2000.MDE"
'Case "D": Kit = "MasterDirectors.MDE"
Case "I": Kit = "Inspection2000.mde"
Case "F": Kit = "Finishing2000.mde"
Case "Q"
If Dir("C:\AccessSystems\Sales2000.mde") = "" Then
FileCopy "V:\Toolkits\Access 2000 Toolkits\Sales2000.mde", "C:\AccessSystems\Sales2000.mde"
End If
Kit = "Sales2000.MDE"
Case "W": Kit = "Moulding2000.MDE"
Case "T": Kit = "Tool2000.MDE"
' Case "Y": Kit = "MasterEnquiry.mde"
Case "Z": Call msgbox("Please launch the download from the Development PC as it is the latest version and will run more efficiently", vbCritical + vbOKOnly, "Warning")
End Select
If Kit <> "X" Then
stAppname = "msaccess.exe" & PathName & Kit
Call Shell(stAppname, 1)
End If
Toolkits = Kit
End Function
In the above example I had a custom menu that listed the applications that the user could open. These were in a shared location on the server.
The command line on the menu item was =ToolKits("x") where X is the parameter sent to the public funcion ToolKits().
As you can see in the code the fisrt thing was to detect if the file existed in the known location then it used FileCopy to copy it from the server to the local machine. This was to reduce the load on the network as Access would have to drag the app across the network along with the data.
I then used Shell to open up the app. The app also appears in the task bar on the desktop so this allows me to tab back to the master mdb and if required I could open up a further mdb.
Hope this helps
David