Begin file search from current location of DB

G

Guest

Hi,
I have a field where I wouldl ike to enter the path of documents which are
related to a particular record. Using Ken Getz' code (thanks) this works
welll. But my database is stored pretty deep down on a server and so are the
documents. This makes searching from C: pretty unfeasable. Is there a way to
begin the file search from the same place the database is stored? I tried the
code below with no luck. Thanks for your help!

Dim strName As String
strFullPath = CurrentDb.Name
strPath = Left$(strFullPath, Len(strFullPath) - Len(Dir(strFullPath)))

strName = ahtCommonFileOpenSave(InitialDir:="strPath", _
Filter:=strfilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Attach file...")

If strName = "" Then Exit Sub

Me.Add_Client_Info = strName
 
D

Douglas J Steele

Remove the quotes from around strPath in the call to ahtCommonFileOpenSave.

You want to pass the content of the variable to the routine: what you've got
passes the literal text string strPath to the routine, which is why it
doesn't work.
 

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