Prompting user to select file in Access 97

  • Thread starter Thread starter rb
  • Start date Start date
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.
 
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
 
Back
Top