Default Pictures Folder

message from Troy B on 20 May 2004
I have an application ready for deployment. I have photos
which is in the Current Path directory. I split the
database and I want the photos in the Database directory
so when I send out updates to the front end the Tables and
photos won't be effected. I've got the Add Photos method
set to the Current Path directory. Can I set path to the
photos to the directory where the user places the tables,
even though I don't know where that directory will be at
the time of installation? I would like for that directory
to show as the default instead of the Current Path.
 
Douglas J. Steele replied to Troy B on 20 May 2004
CurrentProject.Path

or

Left$(CurrentDb().Path, Len(CurrentDb().Path) - Len(Dir$(CurrentDb().Path)))
 
Troy B replied to Douglas J. Steele on 20 May 2004
I think I was not too clear, initially. I want the photos
in the Tables database so I don't alter the photos when I
update the front end. I would like to go to that
directory when I insert photos using a getfile procedure.

either:
(Dir$(CurrentDb().Path)))
photos
method
the
tables,
directory
 
Dirk Goldgar replied to Troy B on 20 May 2004
"Troy B" <anonymous@discussions.microsoft.com> wrote in message
news:ff6601c43ec4$fecebbd0$a401280a@phx.gbl

So you want to know what folder the back-end is in? You can extract
that from the Connect property of one of the linked tables. For
example, here's a function that use a table named "tblProfile" --
assumed to be present -- to get the path to the back-end:

'----- start of code -----
Function fncDataDBName() As String

' Return the name (including path) of the "back-end" database
' containing the data this application is working with. If the
' data tables are local, not linked, return the name of the
' current database.

Static strDBFileName As String

If Len(strDBFileName) = 0 Then
strDBFileName = CurrentDb.TableDefs("tblProfile").Connect
If Left$(strDBFileName, 10) = ";DATABASE=" Then
strDBFileName = Mid$(strDBFileName, 11)
Else
strDBFileName = CurrentDb.Name
End If
End If

fncDataDBName = strDBFileName

End Function
'----- end of code -----
 
Troy B replied to Dirk Goldgar on 20 May 2004
Thank you Dirk, so much. You guys are wonderful.

photos
procedure.
can extract
tables. For
named "tblProfile" --
database
with. If the
of the
("tblProfile").Connect
 

Archived message: Default Pictures Folder (Microsoft Access Forms)