you have to write some code to scan the Folder and check if the batchnumber is in the database
here is code i use
Code:
Function Clear_Photos()
Dim aa
aa = GenerateAllFolderInformation("D:\~WWW\Sites\frenchtouch.co.nz\Big")
aa = GenerateAllFolderInformation("D:\~WWW\Sites\frenchtouch.co.nz\thumbnails")
End Function
Function GenerateAllFolderInformation(FolderName)
Dim FSO
Dim Files
Dim File
Dim Folder
Dim Checkit
Dim CheckName
'MsgBox "Go Have a smoko"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(FolderName)
Set Files = Folder.Files
aa = 0
For Each File In Files
aa = aa + 1
CheckName = Mid$(File.Name, 1, InStr(File.Name, ".") - 1)
Checkit = DCount("*", "Prod", "[TYPE] ='" & CheckName & "'") + DCount("*", "Prod", "[Other Images] Like '*" & CheckName & "*'")
If Checkit = 0 And CheckName <> "" And CheckName <> "Thumbs" Then 'filename not in dataBase
' you put you code in here to added to database
FileCopy File, FolderName & "\Not Used\" & File.Name
Kill File
Else
End If
Next
'MsgBox "Have Finish Moving The Photos to" & vbNewLine & vbNewLine & "p:\photod\not used\"
End Function
i have a database that start at midnite and run the Clear_Photos function
you need to change the Dcount to match your needs