Thanks, John_G.
This is working well. Appreciate your help.
I made changes - marked in red.
I had to include the path to prevent a 'file not found' error.
I decided not to use the Boolean as I felt it was redundant - since I'm exiting the function at the first sign of a file not matching today's date.
And - if I have not exited the function, then it means all dates are today so - just run the Macro.
This is what I ended up using in a function:
Code:
Dim FilePath, FileName As String, AllValid As Boolean
FileName = Dir("C:\Folder\*.xlsx")
FilePath = "C:\Folder\"
Do While FileName <> ""
If DateValue(FileDateTime(FilePath & FileName)) <> Date Then
'Exit at first invalid date
Exit Function
End If
'Get next file name.
FileName = Dir
Loop
DoCmd.RunMacro "MacroName"
Once again - thanks for your time & help.