Im using the code from this post here:
http://www.utteraccess.com/forum/Pop...-t1209291.html
If I dont edit the code at all it tried to open C:/OS, so ive made amendments shown here:
Code:
Private Sub Form_Open(Cancel As Integer)
' if you want you can also file the files in the relevant drive by passing a file extension to the function poplistbox.
'1. To list all files in the directory use: PopListBox("YourFolderOrDriveName")
'2. To list specific files in a diretory use: PopListBox("YourFolderOrDriveName","txt"). To filter by text files. or "xls" ofr excel etc.
With Me.MyListBox
.RowSource = PopListBox("\\SERVER\general\Documents\!management\VBA_Templates_do_not_modify\")
.RowSourceType = "value list"
End With
End Sub
Private Sub MyListBox_DblClick(Cancel As Integer)
On Error Resume Next
Application.FollowHyperlink OpenListItem("Form1", "MyListBox", "\\SERVER\general\Documents\!management\VBA_Templates_do_not_modify\")
End Sub
When using these amendments the code does nothing at all. The hyperlink is correct, Ive made a command button to test:
Code:
Private Sub Command5_Click()
Application.FollowHyperlink ("\\SERVER\general\Documents\!management\VBA_Templates_do_not_modify\")
End Sub
Ive tried a few things with no luck. Any sugestions appreciated.
Note: The purpose of the code right now is to open a document from the list. I will later change the code to do some other things.