find file exists

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I would like to find the file exists or not and try the following it
seems that it return true when directory exists. Is it possible to
check at file level.


If Len(Dir("C:\MyPath\Myfile.txt")) > 0 then
' do something
end if

It looks like return great than zero when the directory exists.
Any way to check the file level.

Your help is great appreciated,
 
iccsi said:
I would like to find the file exists or not and try the following it
seems that it return true when directory exists. Is it possible to
check at file level.


If Len(Dir("C:\MyPath\Myfile.txt")) > 0 then
' do something
end if

It looks like return great than zero when the directory exists.
Any way to check the file level.

Your help is great appreciated,

It works at the file level.

" the Dir function returns the first filename that matches the pathname and
attributes specified. To retrieve additional filenames that match pathname
and attributes, call Dir again with no arguments."
http://www.techonthenet.com/access/functions/file/dir.php
 
Back
Top