SolerPower
New member
- Local time
- Yesterday, 19:47
- Joined
- Oct 29, 2013
- Messages
- 6
Hello
I’m using MS Access 2010. I have a code that I’m using that loops through a folder gather all the names of the files in the folder and inserts them into a table (shown below). The table is named “tblFiles” there are two columns in the table titled file name and file path. What I want to do is to also loop through the same folder to find the file path of the files and insert them into the file path column has a hyperlink where users can just click on the hyperlink and the file opens. Any help would be greatly appreciated.
thank you.
I’m using MS Access 2010. I have a code that I’m using that loops through a folder gather all the names of the files in the folder and inserts them into a table (shown below). The table is named “tblFiles” there are two columns in the table titled file name and file path. What I want to do is to also loop through the same folder to find the file path of the files and insert them into the file path column has a hyperlink where users can just click on the hyperlink and the file opens. Any help would be greatly appreciated.
thank you.
Private Sub Form_Load()
Dim fs, f, f1, fc, s
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblFiles")
folderspec = "S:\Scott\ Guide Revisions\09-2013"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 In fc
rs.AddNew
rs.Fields("FileName") = f1.Name
rs.Update
Next
Set rs = Nothing
DoCmd.Requery "tblfiles subform"
End Sub
Dim fs, f, f1, fc, s
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblFiles")
folderspec = "S:\Scott\ Guide Revisions\09-2013"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 In fc
rs.AddNew
rs.Fields("FileName") = f1.Name
rs.Update
Next
Set rs = Nothing
DoCmd.Requery "tblfiles subform"
End Sub