PC Review


Reply
Thread Tools Rate Thread

Begin file search from current location of DB

 
 
=?Utf-8?B?QmVu?=
Guest
Posts: n/a
 
      3rd Mar 2006
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
 
Reply With Quote
 
 
 
 
Douglas J Steele
Guest
Posts: n/a
 
      3rd Mar 2006
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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i tell a macro to begin in the current cell? =?Utf-8?B?bWFyd2lsZGZ3?= Microsoft Excel Programming 6 12th May 2006 10:36 PM
Macro to cause Explorer to open in same file path location that current file is located. cparnell@southernstorefixtures.com Windows XP General 0 11th Jan 2006 10:26 PM
Saving a TXT file keeping its current location Chichifo Microsoft Excel Programming 1 7th Sep 2004 07:39 PM
How do I enable 'open file from current location' in IE6 Steve Microsoft Windows 2000 Enable 1 16th Dec 2003 05:31 PM
Re: Downloading a file by choosing open from the current location H Leboeuf Windows XP Internet Explorer 0 12th Aug 2003 03:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 AM.