full path

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

HI!

In my application I use images and these images reside
on a Shared drive.
Ex: z:\PWGSC\Images\redflag.bmp

The shared drive letter might eventuly change and I won't
be there to manually change them.

How to I point to the same image without putting the full
path name. All these files reside in the same folder has
the currenDB.

I know there a trick to it but I can't remember what
exactly.

This needs to work in VBA and in the Picture property
of an image.

Can you help me!!

Patrick
 
Patrick said:
HI!

In my application I use images and these images reside
on a Shared drive.
Ex: z:\PWGSC\Images\redflag.bmp

The shared drive letter might eventuly change and I won't
be there to manually change them.

How to I point to the same image without putting the full
path name. All these files reside in the same folder has
the currenDB.

I know there a trick to it but I can't remember what
exactly.

This needs to work in VBA and in the Picture property
of an image.

Can you help me!!

Patrick

The path to the database is readily available from
Application.CurrentProject.Path, if you're running Access 2000 or later,
or can be extracted easily with a little code from CurrentDb.Name if
you're running Access 97. So you could store just the name of the file
in your database, and then append the path when setting the Picture
property of an Image control.

But are you saying this database file is being shared by multiple users?
Does this mean you haven't split your database into front-end and
back-end .mdb files, with the back-end on the server and a copy of the
front-end on each user's PC? If not, then you're leaving yourself open
for more corruption problems than you need to; see Tony Toews' page on
splitting your application:

http://www.granite.ab.ca/access/splitapp.htm

If you have split your application, where will the images be -- on the
server or on the user's PC? If on the server, you'll need to extract
the path to the server folder from the Connect property of one of the
linked TableDefs:

Dim strServerFolder As String

strServerFolder = CurrentDb.TableDefs("tblProfile").Connect
strServerFolder = _
Mid$(strServerFolder, InStr(strServerFolder, ";DATABASE=") + 10
 
Thanx for all the possibilities,I think its best for this
application to just get the path of my DB(current one) and
append-it to the image minus a few twics in and there.

In the mean time, I'm will take a look at Spliting my DB.
Its something that I've been reading about on alot of
newsgroups, and it seams to be the way to go for a muti-
user DB.

Thanx again,
-----Original Message-----


The path to the database is readily available from
Application.CurrentProject.Path, if you're running Access 2000 or later,
or can be extracted easily with a little code from CurrentDb.Name if
you're running Access 97. So you could store just the name of the file
in your database, and then append the path when setting the Picture
property of an Image control.

But are you saying this database file is being shared by multiple users?
Does this mean you haven't split your database into front- end and
back-end .mdb files, with the back-end on the server and a copy of the
front-end on each user's PC? If not, then you're leaving yourself open
for more corruption problems than you need to; see Tony Toews' page on
splitting your application:

http://www.granite.ab.ca/access/splitapp.htm

If you have split your application, where will the images be -- on the
server or on the user's PC? If on the server, you'll need to extract
the path to the server folder from the Connect property of one of the
linked TableDefs:

Dim strServerFolder As String

strServerFolder = CurrentDb.TableDefs ("tblProfile").Connect
strServerFolder = _
Mid$(strServerFolder, InStr
(strServerFolder, ";DATABASE=") + 10
 
Back
Top