neilwebber
Registered User.
- Local time
- Today, 19:56
- Joined
- Aug 19, 2002
- Messages
- 35
Hello All
I have a shared database which contains a button which opens Arcview GIS and runs a script, zooming to a particular site depending on a value passed from access. The code on this button is given below.
My problem is.....
One of the users does not have Arcview installed on their PC but on a laptop (visible as M:\ on their PC). Therefore the line Shell("C:\etc") does not execute, it needs to be Shell("M:\etc") for this particular user.
Can anyone suggest some code to add so that:
If Shell("C:\etc") does not execute or is invalid or not found or whatever, then execute Shell("M:\etc") instead, but ignore Shell("M:\etc") if Shell("C:\etc") is True.
Alternatively, am I approaching this the wrong way and missing a more obvious alternative? I'm stumbling about in unknown territory here and any suggestions are warmly welcomed.
regards
Neil
The code:
Private Sub btnGoToAVBasics_Click()
If IsNull(DaughterSiteNumber) Then
Exit Sub
End If
On Error Resume Next
Dim chan As Variant
Dim request, answer As String
request = Forms![frmDaughterSites]![tblDaughterSitesSbf]![DaughterSiteNumber]
chan = DDEInitiate("arcview", "system")
If Err Then
Err = 0
I = Shell("C:\ESRI\AV_GIS30\ARCVIEW\bin32\ArcView C:\GIS\AccessProject\base.apr", 1)
If Err Then
MsgBox "DDE Connection Error"
Exit Sub
End If
chan = DDEInitiate("arcview", "system")
End If
DDERequest chan, "av.run(""ZoomFromAccess"",""" & request & """)"
DDETerminate chan
End Sub
I have a shared database which contains a button which opens Arcview GIS and runs a script, zooming to a particular site depending on a value passed from access. The code on this button is given below.
My problem is.....
One of the users does not have Arcview installed on their PC but on a laptop (visible as M:\ on their PC). Therefore the line Shell("C:\etc") does not execute, it needs to be Shell("M:\etc") for this particular user.
Can anyone suggest some code to add so that:
If Shell("C:\etc") does not execute or is invalid or not found or whatever, then execute Shell("M:\etc") instead, but ignore Shell("M:\etc") if Shell("C:\etc") is True.
Alternatively, am I approaching this the wrong way and missing a more obvious alternative? I'm stumbling about in unknown territory here and any suggestions are warmly welcomed.
regards
Neil
The code:
Private Sub btnGoToAVBasics_Click()
If IsNull(DaughterSiteNumber) Then
Exit Sub
End If
On Error Resume Next
Dim chan As Variant
Dim request, answer As String
request = Forms![frmDaughterSites]![tblDaughterSitesSbf]![DaughterSiteNumber]
chan = DDEInitiate("arcview", "system")
If Err Then
Err = 0
I = Shell("C:\ESRI\AV_GIS30\ARCVIEW\bin32\ArcView C:\GIS\AccessProject\base.apr", 1)
If Err Then
MsgBox "DDE Connection Error"
Exit Sub
End If
chan = DDEInitiate("arcview", "system")
End If
DDERequest chan, "av.run(""ZoomFromAccess"",""" & request & """)"
DDETerminate chan
End Sub