Question : How can I make access to trigger an alert when one of the folders (eg c:/folder) does not have any files that has been created in the last 90 days?

I am building an access database. I would like to have a field which basically triggers an alert when a specific folder does not have any files that was created in the last 90 days.

Is this achievable?

Answer : How can I make access to trigger an alert when one of the folders (eg c:/folder) does not have any files that has been created in the last 90 days?

Never mind, I see the problem.  Sorry.  Replace the code with the version below.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
Private Function NewestFileInFolder(strFolderPath As String) As Integer
    Dim objFSO As FileSystemObject, objFolder As Object, objFile As File, intTemp As Integer, bolFirstPass As Boolean
    Set objFSO = CreateObject("Scripting.FileSystemobject")
    Set objFolder = objFSO.GetFolder(strFolderPath)
    bolFirstPass = True
    For Each objFile In objFolder.Files
        intTemp = DateDiff("d", objFile.DateCreated, Date)
        If bolFirstPass Then
            NewestFileInFolder = intTemp
            bolFirstPass = False
        Else
            If intTemp < NewestFileInFolder Then NewestFileInFolder = intTemp
        End If
    Next
    Set objFile = Nothing
    Set objFolder = Nothing
    Set objFSO = Nothing
End Function
Random Solutions  
 
programming4us programming4us