IF Stmt To Check For Presence of Files Before Executing A Marco

  • Thread starter Thread starter Cindy Lovell
  • Start date Start date
C

Cindy Lovell

Is there a way to make a conditional macro where the
condition is based on presence of files? The macro I want
to execute has transfer text file commands and then
executes some queries. I don't want to run this macro, if
the text files do not exist. I need to create another
macro that has a condition to check for the presence of
the files - if found, execute the other macro, if not
found then end.

Thanks for your help!
Cindy
 
Cindy,

Use this syntax in your macro Condition...
Len(Dir("C:\YourPath\YourFile.txt"))>0

- Steve Schapel, Microsoft Access MVP
 
Thanks Steve. That worked great!

Cindy
-----Original Message-----
Cindy,

Use this syntax in your macro Condition...
Len(Dir("C:\YourPath\YourFile.txt"))>0

- Steve Schapel, Microsoft Access MVP




.
 
Back
Top