Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Spreadsheet within Same database path

Status
Not open for further replies.

Stoffman

Programmer
Apr 6, 2005
42
GB
Does anyone know if it possible to import a spreadsheet with a known name that sits within the same file location as the database however this location isn't known. This database will be in multiple file locations and I want the code to be dynamic
Cheers Chris
 
Have a look at the CurrentProject.Path property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for that but as I am only a newbie to this I need a bit more info. I have been looking in the Object Browser and the help, and I can't find anything. Could you give me an example of how this is used

Cheers Chris
 
In the debug window (Ctrl+G) type the following:
? CurrentProject.Path
After pressing the enter you should see the location of your database (provided you don't play with an old version of access).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I get a Runtime Error 424. I assume that Access 97 is just too Old. Any other suggestions ???

Cheers Chris
 
So, you may consider playing with the CurrentDb.Name property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top