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.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Ben" <(E-Mail Removed)> wrote in message
news:BF0AA066-B7DE-473E-A3D2-(E-Mail Removed)...
> 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