Getting new pathname information

D

Dave the Wave

Hi:
I am trying to get path information from the user. With Excel, I use the
GetOpenFilename function which returns the full name (including path). I
can then parse the path information and use it to set any dynamic external
references. I can find no equivalent command in Access. The information
I've found at Lebans and similar web sites seem to be overkill for what I
need to accomplish.

Any suggestions or other resource links will be greatly appreciated.

Thanks!
 
D

Dave the Wave

Not sure where you're trying to use this, but in a code module,
CurrentDb.Name
will return the path and file name of the database.

The problem is that the path information I'm looking for is for another
file in a different location on another computer on the network. I'm trying
to automate the linking process to a back end file.

I'm hoping to create a code snipit that would require the user only locate
the back end file. I would use code to complete the linking process. (My
develpoment machine is not on the network where the Access file is used. I
could hard code the directory information in, but I wanted something a
little more elegant and flexible. I assumed there was similar function in
Access as the "GetOpenFilename" function in Excel.)
 
R

Roger Carlson

Oh! You want to use the standard Windows File Open/Save dialog box. It
will allow you to navigate to whatever folder you want. You can find
information on it here:
http://www.mvps.org/access/api/api0001.htm

I've created a small Access database sample that use this process. It's
called "PicturesLoad.mdb", and you can find it here:
http://www.rogersaccesslibrary.com/download3.asp?SampleName=PicturesLoad.mdb

NOTE: while this sample is specifically for loading a picture into a
database, the process by which you find the file you want is identical to
what you want to do. The only difference is what you do with the path and
filename once you select it.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Top