hello all
I have the following code, for some reason it will not go to the last folder. When button is clicked it goes to the Applications folder. I have tried a few different things and searched thru this forum and cannot find a solution. This should be simple but my brain hurts - i know that there is a space inbetween the ws and file. I have tried to use _ and still doesnt work. I have hyperlinks set up for a ton of records, so i cannot change the file folder name (WS FILE)
Any help is greatly appreciated!
Thanks
Raven
I have the following code, for some reason it will not go to the last folder. When button is clicked it goes to the Applications folder. I have tried a few different things and searched thru this forum and cannot find a solution. This should be simple but my brain hurts - i know that there is a space inbetween the ws and file. I have tried to use _ and still doesnt work. I have hyperlinks set up for a ton of records, so i cannot change the file folder name (WS FILE)
Any help is greatly appreciated!
Code:
Dim fd As Office.FileDialog
Dim varfile As Variant
Dim infilen As Variant
infilen = "N:\Applications\WS_FILE"
'Set up file picker dialog box
10 Set fd = Application.FileDialog(msoFileDialogFolderPicker)
20 With fd
'do not allow users to select multiple files
30 .AllowMultiSelect = False
'set the title of the dialog box
40 .TITLE = "SELECT THE WS FOLDER ASSOCIATED TO THIS RECORD"
'Point to the correct path within the S Drive
50 .InitialFileName = infilen
60 If .Show = True Then
70 For Each varfile In .SelectedItems
80 Me!VIEWWSMB = varfile
90 Next
100 Else
110 MsgBox "YOU CLICKED CANCEL IN THE FILE DIALOG BOX"
120 End If
130 End With
Thanks
Raven