To check if a File Exist

  • Thread starter Thread starter Vina
  • Start date Start date
V

Vina

I have a form with a command button to import a file and
delete it but if the file doesnt exist it causes an error.
Can someone help me what function or code can i use to
check if that file exist in the folder and if so then run
the import and delete or else not.

Thanks
Vina
 
Vina said:
I have a form with a command button to import a file and
delete it but if the file doesnt exist it causes an error.
Can someone help me what function or code can i use to
check if that file exist in the folder and if so then run
the import and delete or else not.

If Dir("PathToFile") = "" Then
'The File Doesn't Exist
Else
'The File Exists
End If
 

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

Similar Threads

Check if a date exists in a record 1
Check if objects exist 2
Folder Exists 2
Easy Steps to Import PST Files to Office 365 0
File of a photo exist 1
Check For File 4
Is File Open 8
Check if an external file exists 3

Back
Top