By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,635 Members | 913 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,635 IT Pros & Developers. It's quick & easy.

Opening a jpg file. Code from Lebans

P: n/a
I use access 2002 with windows XP. I don't think that I encountered the same
problem with Windows 2000

The following opens an image (code from Lebans)
fLoadPicture Me.JGSForm.Form.Image1, "e:\pictures\test.jpg"
if I specify the path and file name as above then the picture opens

My problem: If I specify it as follows
fLoadPicture Me.JGSForm.Form.Image1, IPath & Me!StCode & ".jpg"
then the picture opens but windows explorer also opens automatically and I
have to close windows explore first

the exact same happens if I use
MyImage = IPath & Me!StCode & ".jpg"
Application.FollowHyperlink MyImage, , True
If I use "c\pictures\test.jpg" instead of MyIimage then again windows
explorer opens to c:\pictures\test.jpg
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try running this code with a Debug.Print of the generated path and filename
just before the LoadPicture, with a breakpoint on the Load Picture
statement. My guess would be that there is something gone awry with your
building the string for path and filename.

Larry Linson
Microsoft Access MVP

"Alfred" <sp**************@hotmail.com> wrote in message
news:bn**********@ctb-nnrp2.saix.net...
I use access 2002 with windows XP. I don't think that I encountered the same problem with Windows 2000

The following opens an image (code from Lebans)
fLoadPicture Me.JGSForm.Form.Image1, "e:\pictures\test.jpg"
if I specify the path and file name as above then the picture opens

My problem: If I specify it as follows
fLoadPicture Me.JGSForm.Form.Image1, IPath & Me!StCode & ".jpg"
then the picture opens but windows explorer also opens automatically and I
have to close windows explore first

the exact same happens if I use
MyImage = IPath & Me!StCode & ".jpg"
Application.FollowHyperlink MyImage, , True
If I use "c\pictures\test.jpg" instead of MyIimage then again windows explorer opens to c:\pictures\test.jpg

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.