I been tasked with finding all documents to Zip them down to save space. Anyway here is my code so far. I would like to save it in a table and create reports later.
Each folder has one or more under it and so on.
So I need to call the same ocde over and over, I guess.
All I have is Access to program with, No VB6 and I don't know VB.NET good enough.
TIA
DougP
Each folder has one or more under it and so on.
So I need to call the same ocde over and over, I guess.
Code:
Dim Conn2 As ADODB.Connection
Dim Rs1 As ADODB.Recordset
Dim SQLCode As String
Set Conn2 = CurrentProject.Connection
Set Rs1 = New ADODB.Recordset
SQLCode = "SELECT * FROM [FoldersFound];"
Rs1.Open SQLCode, Conn2, adOpenStatic, adLockOptimistic
'MyPath = "F:\CLIENT ADMIN TAMPA 2007\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Debug.Print MyName ' Display entry only if it's a directory
CurrentDir = MyName
If MyName = "Project Reports" Then
GetFileInProjectReports
End If
Else
Rs1.AddNew
Debug.Print MyName 'this is a file in that folder
Rs1![Folder Name] = CurrentDir
Rs1![File Name] = MyName
Rs1![File Size] = FileLen(MyName)
Rs1.Update
End If
End If
MyName = Dir ' Get next entry.
Loop
TIA
DougP