Show image on form

geno

Registered User.
Local time
Today, 10:52
Joined
Jun 19, 2000
Messages
243
Hi,
I have a customer who sells auto parts. He has asked me that when he opens the parts form to a part an image of the part will show. He has a folder with all the part images and they are named with the part ID. I know I could do this by typing in the path to each part but there are over 1000 parts. My question: is there an easier way to do this? Is there a way to use the part ID in a lookup or something.

Thanks
 
First of all, you already know where (folder path) the images are stored.
Second, you already know that all images are named after their unique part number.
Third, check to see if all images are JPG, TIF, etc...

Create an image object on the form.
e.g Img1

Properties:
Picture = (none)
Picture Type = Linked

Code:
Private Sub Form_Load()

     Img1.Picture = "C:\PartImages\" & me.txtPartNumber & ".jpg"

End Sub
 
Thanks works great. One problem though some parts don't have images how can I trap the error if a part doesn't have an image?

Thanks
 
Figured it out works great.

Thanks again for your input.

Geno
 

Users who are viewing this thread

Back
Top Bottom