Yes see attachments please. This is what I see on the DB when I press submit nothing happensAre there files created within the date range in the folder?
Yes see attachments please. This is what I see on the DB when I press submit nothing happensAre there files created within the date range in the folder?
LoL you have noticed that as wellThat is a very narrow range? Try something bigger as it definitely works.
Also how can you have a Date Created after a Date Modified?
View attachment 94789
I think thats Copy and paste.Also how can you have a Date Created after a Date Modified?
I have never seen that before!
Set fso = New FileSystemObject
If Len(Dir(strFolder, vbDirectory)) = 0 Then Exit Function
Set fol = fso.GetFolder(strFolder)
For Each fil In fol.Files
'If fil.DateCreated >= dteStart And fil.DateCreated <= dteEnd Then
lbx.AddItem Format(fil.DateCreated, "Short Date") & ";" & fil.Path
'End If
Next
just looked at the original folder and it shows the same issue with the dates hahaDefinitely happens. I just downloaded a file from one of my client's FTP sites. Due to the way my FTP client happens to handle this task, the date created shows the moment I downloaded it. But the date modified shows 15 minutes earlier.
Can be common in file transfer situations, depending on how the transfer client interacts with Windows.
tried it & there are 53 files created on 9/24/2021 and it shows only 2. & 300+ on 9/16/2021.. it does not look like it is loading all the 9/16/2021 eithertry commenting out the "If" and the "end if" lines and see if it lists all the files.
Code:Set fso = New FileSystemObject If Len(Dir(strFolder, vbDirectory)) = 0 Then Exit Function Set fol = fso.GetFolder(strFolder) For Each fil In fol.Files 'If fil.DateCreated >= dteStart And fil.DateCreated <= dteEnd Then lbx.AddItem Format(fil.DateCreated, "Short Date") & ";" & fil.Path 'End If Next
I understand your point; however, I have not clue as how to code the approach you are suggesting@NahualXl
This is your application and you can do whatever you want but I'm telling you from experience, that at some point your users will either miss files or double import them if you persist in using this technique. It is an accident waiting to happen.
Here's another example which has some of Pat's ideas in it, although a little less robust.I understand your point; however, I have not clue as how to code the approach you are suggesting
If strFile.DateCreated > (txt_Start_Date - 1) And strFile.DateCreated < (txt_Start_Date2 + 1) Then
"error" invalid qualifier here -> strFile.DateCreatedWhat tweaks?Code:If strFile.DateCreated > (txt_Start_Date - 1) And strFile.DateCreated < (txt_Start_Date2 + 1) Then
if dates are not working it could be you're comparing a date to a string.
You'll also need fso to get the date created property.
yea, you need to use fso to get the created date"error" invalid qualifier here -> strFile.DateCreated