P
pilch74
I just wanted to say 'hi' first of all, I'm a relative n00b to Access n
the scheme of things and a colleague recommended Google Groups for
advice and hear I am.
Having already subscribed to some groups that suit my particular taste
I would like to share a function that combines the DateDiff and the
FileDateTime functions to display the number of days between an
external file and today's date. Of course this can be tweaked to your
liking.
This example below says 'Check to see if dates.txt is older than 36
days'
DateDiff("d",Date(), FileDateTime("D:\_EXTRACTS_\dates.txt")) >= -36
This will hopefully be of use for anyone who needs to check the age of
an external file prior to using the TransferText command within a macro
to populate a table.
Don't forget that you can do some nice test debugs using the
'Immediate' window panel (CTRL&G) within VBA mode) first to get a feel
for your functions and dates of files etc.. i.e
Debug.Print DateValue(FileDateTime("D:\_EXTRACTS_\dates.txt"))Date()
- will show you the date of dates.txt and today's date.
I hope this makes sense, English was never my strong point.
And also perhaps as a security measure we should all be checking if the
file exists first ?
Regards,
Richard
the scheme of things and a colleague recommended Google Groups for
advice and hear I am.
Having already subscribed to some groups that suit my particular taste
I would like to share a function that combines the DateDiff and the
FileDateTime functions to display the number of days between an
external file and today's date. Of course this can be tweaked to your
liking.
This example below says 'Check to see if dates.txt is older than 36
days'
DateDiff("d",Date(), FileDateTime("D:\_EXTRACTS_\dates.txt")) >= -36
This will hopefully be of use for anyone who needs to check the age of
an external file prior to using the TransferText command within a macro
to populate a table.
Don't forget that you can do some nice test debugs using the
'Immediate' window panel (CTRL&G) within VBA mode) first to get a feel
for your functions and dates of files etc.. i.e
Debug.Print DateValue(FileDateTime("D:\_EXTRACTS_\dates.txt"))Date()
- will show you the date of dates.txt and today's date.
I hope this makes sense, English was never my strong point.
And also perhaps as a security measure we should all be checking if the
file exists first ?
Regards,
Richard