Problem with Importing Excel File

L

lynn

I have button in my form to import an excel file to my
Database.When I click the button, an inputbox is poping up
with a message , "Please Enter the path of the file". If I
enter the path correctly the program works fine. If I
don't enter the path correctly, nothing happened in my
form.I have to give this program to my customers in order
to update the database. If they don't enter the path
correctly, how can I give warning to them ? Is there any
code for that?. Any help. It is really appreciated.
 
D

Douglas J. Steele

You can use the Dir function to determine whether or not a file exists. If
strFile contains the complete path to the file, then Len(Dir(strFile)) will
be 0 if the file doesn't exist.

However, why not grab the code in http://www.mvps.org/access/api/api0001.htm
and let them pick from the standard Windows File Open dialog, rather than
having to type it?
 

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