Using Environmental Variable in the Picture Property

J

jitsu

Hi All,

Why is it not possible to put an environmental variable (EV) into the
picture property of a image in the form?

E.g.:
I have set an EV %MyPicture% in Win XP with the path C:\picture1.jpg.
I want to put this picture to the form as linked picture, but when I
put the EV %MyPicture% in the field Picture of the Property box, I got
an error message "MS Access cannot open the file ...".

But for example in the StartUp Option of the database I can use the EV
in the Application Icon field.

Could someone help?

Thanks

Jitsu
 
D

Douglas J. Steele

To get the value of an environment variable in Access, you use the Environ
function. In your case, you'd use Environ("MyPicture")

Unfortunately, though, you can't set the Picture property to
=Environ("MyPicture") & "\picture1.jpg" in the Property window, but you can
using VBA.
 
J

jitsu

Hi Doug,
Meny thanks for your reply.

I was a bit afraid, that this is the only way.

But anyway thank you :)

Jitsu
 

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