find file exists

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,
 
M

Mike Painter

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top