Prompting user to select file in Access 97

R

rb

How do I use VBA to prompt the user to select an excel
file, which the system will then return the location of
the file as a string so I can use it in the import string
for the location of the file? Basically I'm trying to
automate importing an excel file into the database, but
the file will have a different name each month so I want
them to be able to just select the file and the system
will automatically import the information.

Thanks.
 
D

Dirk Goldgar

rb said:
How do I use VBA to prompt the user to select an excel
file, which the system will then return the location of
the file as a string so I can use it in the import string
for the location of the file? Basically I'm trying to
automate importing an excel file into the database, but
the file will have a different name each month so I want
them to be able to just select the file and the system
will automatically import the information.

Thanks.

If you're using Access 2002 or later, you can use the built-in
Application.FileDialog, which you'll find in the online help. If not,
the most reliable way is to call the Windows API directly, using the
handy code at:

www.mvps.org/access/api/api0001.htm
 

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