Image Control Problem

P

panlag

Is there anyway to use a relative path for an image control?

Basically, my problem is that initially, pictures for my image controls
must be identified using absolute paths - and this is inefficient as
I've basically got to work on two different computers.

I have some code that allows me to to use "relative" paths, however,
the initial image seems to require absolute paths, else I get the
message:

"Microsoft Office Access can't open the file "[filename]"" which is
annoying since it repeats itself 9 times (i have 9 images).

Is there any way around it?
 
B

Bob Hairgrove

Is there anyway to use a relative path for an image control?

Basically, my problem is that initially, pictures for my image controls
must be identified using absolute paths - and this is inefficient as
I've basically got to work on two different computers.

I have some code that allows me to to use "relative" paths, however,
the initial image seems to require absolute paths, else I get the
message:

"Microsoft Office Access can't open the file "[filename]"" which is
annoying since it repeats itself 9 times (i have 9 images).

Is there any way around it?

You don't have to have an initial image if you are setting the path in
code. You could store the relative paths in the table, then set up the
complete path in the form's OnLoad or OnCurrent event.
 
K

Klatuu

Here is a site to an API that deals with absolute and UNC drive mapping:

http://www.mvps.org/access/api/api0003.htm

There is a function included called fGetUncPath. it will return the UNC
path for the drive letter.

Before you call that function for a drive letter, you should use the
fDriveType function to be sure it returns "Network Drive"; otherwise, you
will throw an error if you try to get the UNC path of a non network drive.
So basically, it would be:

strDriveLetter = "E:"

If fDriveType(strDriveLetter) = "Network Drive" Then
strUNCPath = fGetUncPath(strDriveLetter")
End If
 
N

nobody

Thanks for the help! It took a little bit of problem solving, but I
finally mangaged to get rid of the initial picture!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top