Import file in current folter

T

Tony

I'm using the TransferSpreadSheet function to importdata
from an excel spread. The *.xls file is in the same
folder as the database. I would like for the program to
look in this folder (current folder) for the file rather
than the default data folder. When I type in the filename
is there a way to indicate the current folder without
typing it in.

The name of the current folder will be different on
different computers.

Thanks...
 
K

Ken Snell

You can use the CurrentProject.Path in the code to be the current path.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"TableName",CurrentProject.Name & InputBox("Enter the filename.")
 

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