String/date concatenation?

  • Thread starter Thread starter John Davis
  • Start date Start date
J

John Davis

Hi all,

I'm trying to write a function that will look for a
specific text file and, if present, import it into
Access. I want to use this function as part of a
scheduled macro. I know how to check for the presence of
a file, but my problem is how to write the code that will
recognize the file name.

Specifically, my files are genereated daily in the format
of:
REPORTING_20031130.TXT
REPORTING_20031201.TXT
etc

I don't know how to write the code to have the function
automatically check to see if the file has today's date on
it in the specified format.

Any suggestions?

Thanks in advance!
 
Dir("C:\MyFolder\REPORTING_" & Format(Date(), "yyyymmdd") & ".TXT") <> ""

The above condition will be true if the file exists; false if it doesn't.
 
Back
Top