We just moved our database to a more secure volume, and everything is great except for one thing: I have a button on a form that opens a specific folder based on the record in hand. The path is pretty simple (it used to be "V:\Pre-Admitting\eChar ts\"), and it worked like a charm. The new location is "V:\IUR\eCharts ", but when I replaced the string in my code, I get a "Path not found" error.
I can't figure out what's wrong, since the permissions are correct (I can navigate to the path outside of the database), and the path does actually exist, and it worked great with the old address.
Here's the code:
Any help will be greatly appreciated!
I can't figure out what's wrong, since the permissions are correct (I can navigate to the path outside of the database), and the path does actually exist, and it worked great with the old address.
Here's the code:
Code:
Private Sub Open_eChart_Click()
On Error GoTo Err_Open_eChart_Click
Dim retVal As Variant
Dim strPartialPath As String
Dim intCounter As Integer
Dim strThisChar As String
Const conPAth As String = "V:\IUR\eCharts\"
If Not IsNull(Me![ChartNum]) Then
If Left$(Me![ChartNum], 1) = "\" Then
strPartialPath = Mid$(Me![ChartNum], 2)
Else
strPartialPath = Me![ChartNum]
End If
Else
Exit Sub
End If
'Replace any commas with underscores
For intCounter = 1 To Len(strPartialPath)
strThisChar = Mid(strPartialPath, intCounter, 1)
If strThisChar = "," Then
strPartialPath = Left(strPartialPath, intCounter - 1) & _
"_" & _
Mid(strPartialPath, intCounter + 1, 255)
End If
Next
If Dir$(conPAth & strPartialPath, vbDirectory) <> "" Then
retVal = Shell("Explorer.exe " & conPAth & strPartialPath, vbNormalFocus)
Else
MkDir (conPAth & strPartialPath)
retVal = Shell("Explorer.exe " & conPAth & strPartialPath, vbNormalFocus)
End If
Exit_Open_eChart_Click:
Exit Sub
Err_Open_eChart_Click:
MsgBox Err.Description
Resume Exit_Open_eChart_Click
End Sub
Comment