linked picture

junkmale

Registered User.
Local time
Today, 15:14
Joined
Sep 8, 2003
Messages
36
i found that a small increase in size of a picture file used as background in my database leads to a huge increase in size of the database file.

having a linked file (as compared to embedding one) works much better, especially when the particular picture is used in several forms.

however, there is a problem when i have to relocate the database file... because the link is to c:\my documents\my pictures\........

the link is invariably "lost" when the file is moved to another computer.

is there something i can do to get MS Access to call up the picture as long as it is in the same directory?

[PS: if this is not possible, do let me know also, so i will revert to a much simpler or perhaps not have a background... thanks!]
 
Last edited:
Junkmale

I always store my databases in a folder with a standard name.
eg. 'My Database'

In that folder I have another folder called 'Icons'

I always store picture files in the 'Icon' folder.

When I install on other machines I create the 'My Database' and 'Icons' folders to hold my files. This keeps all associations within the dbase, working.

This is what I do. Hope it gives you some ideas.

Tom
 
Thanks for the speedy reply.

I guess that works... but i'll be "shifting" my database around computers quite a bit...

Is there a way to make it link to a file as long as it's in the same directory?
 
if the picture is in the same dir as the database then just don't use the path at all and it will automatcailly look in the db's directory. Otherwise use:

Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))

to return the path of the current database and add your picture file to that.
 
I've tried not using the path at all, ie simply typing "pictname.jpg" in the field... but it does not work.
"Microsoft Access can't open the file pictname.jpg."
I have to key in the exact path for it to work.

Fornatian said:
if the picture is in the same dir as the database then just don't use the path at all and it will automatcailly look in the db's directory. Otherwise use:

Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))

to return the path of the current database and add your picture file to that.

I'm currently selecting the picture by right clicking, properties, fomat, picture...

i've no idea where to use this command in that case.

That is, where and how do i use this:

Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))


Thanks.
 
that's strange, missing the path off works fine on my version(A97). Anyway to set the picture at run time add this code to the OnOpen event of your form:

Me.MyPic.Picture = Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name))) & "\YourPicture.Ext"

Alternatively you could have the path to the current db stored in a table and extract it from there.
 
i'm using Access2002, but still perturbed nonetheless by why simply typing the filename doesn't work.

Anyway, Thanks!
 

Users who are viewing this thread

Back
Top Bottom