Picture Link

C

ChoonBoy

Appreciate some help here and thanks in advance.

I link my pictures to the following folders

C:\Documents and Settings\MyName\Desktop\Picture.jpg
C:\Documents and Settings\MyName\My Documents\Picture.bmp

My code:
If Me!pic1a = "X" Then
Forms!startpg!fmpPic!Img.Picture = ""
Else
Forms!startpg!fmpPic!Img.Picture = Me!pic1a
End If

It works on my PC but when I copied the program to another PC, it does not
work.

This is because of "MyName" and the other PC has a different name. Is there
a way to ignore "MyName" for any PCs

Regards
 
B

Brendan Reynolds

ChoonBoy said:
Appreciate some help here and thanks in advance.

I link my pictures to the following folders

C:\Documents and Settings\MyName\Desktop\Picture.jpg
C:\Documents and Settings\MyName\My Documents\Picture.bmp

My code:
If Me!pic1a = "X" Then
Forms!startpg!fmpPic!Img.Picture = ""
Else
Forms!startpg!fmpPic!Img.Picture = Me!pic1a
End If

It works on my PC but when I copied the program to another PC, it does not
work.

This is because of "MyName" and the other PC has a different name. Is
there
a way to ignore "MyName" for any PCs

Regards


There's code to retrieve the location of these and other folders at the
following URL ...

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

It's a lot of code, but you just need to copy and paste it into a standard
module. Once you've done that, calling the code is easy ...

? fgetspecialfolderlocation(csidl_personal)
C:\Users\Brendan Reynolds\Documents
? fgetspecialfolderlocation(csidl_desktopdirectory)
C:\Users\Brendan Reynolds\Desktop
 

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