Hi all,
I am using the below code to open a specific file location on the network but it opens "My Documents" on the local C:\ drive
Any suggestions please
I am using the below code to open a specific file location on the network but it opens "My Documents" on the local C:\ drive
Any suggestions please
Code:
Private Sub cmdBrowse_Click()
On Error GoTo Err_Handler
Dim SB_Attachment As String
Dim strFolder As String
Dim strFile As String
Dim intPos As Integer
SB_Attachment = BrowseFile
If SB_Attachment <> "" Then
' get folder and file names
intPos = InStrRev(SB_Attachment, "\\Sjo2054\shared\Data_Files\")
strFolder = Left(SB_Attachment, intPos - 1)
strFile = Mid(SB_Attachment, intPos + 1)
' populate text boxes on form
Me.SB_Attachment = SB_Attachment
End If
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Here
End Sub