J
Jacob
I am using Access 2003 and have this code in my DB to bring back a list of
PDF forms.
Dim mypath As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblSvc") ' open the table
mypath = "E:\Service Manuals\*.*"
MyName = Dir(mypath) ' Retrieve the first PDF file in that folder.
Do While MyName <> "" ' Start the loop.
rs.AddNew ' add a new record to the MyFiles table
rs!book = mypath ' set the value of the path
rs!book = MyName ' fill in the current filename
MyName = Dir ' Get next entry.
rs.Update ' actually write the record into the table
what I need to have it do is look in sub folders as well. What do I need to
add to this to make this happen? Any help is greatly appreciated.
PDF forms.
Dim mypath As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblSvc") ' open the table
mypath = "E:\Service Manuals\*.*"
MyName = Dir(mypath) ' Retrieve the first PDF file in that folder.
Do While MyName <> "" ' Start the loop.
rs.AddNew ' add a new record to the MyFiles table
rs!book = mypath ' set the value of the path
rs!book = MyName ' fill in the current filename
MyName = Dir ' Get next entry.
rs.Update ' actually write the record into the table
what I need to have it do is look in sub folders as well. What do I need to
add to this to make this happen? Any help is greatly appreciated.