• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

How populate image from a combobox

I have a form which has a combobox.  Also on the form is an image "field".  The after update event of the combobox isn't populating the image.  Here is my code:

Me.imgImage = Me.cboProdName.Column(3)

And here is the SQL of the combobox:

SELECT tblProductNames.ProdNameID, tblProductNames.ProdNameDesc, tblOrientations.OrientationDesc, tblProductNames.Image
FROM tblProductNames LEFT JOIN tblOrientations ON tblProductNames.OrientationID = tblOrientations.OrientationID
ORDER BY tblProductNames.ProdNameDesc;


Can this even be done?
0
SteveL13
Asked:
SteveL13
  • 4
  • 3
1 Solution
 
SheilsCommented:
Try using the onchange event of the combo box
0
 
SteveL13Author Commented:
Didn't work.  I have other fields populating with the afterupdate event but the image will not.

???
0
 
SheilsCommented:
How are you assigning the image to the image control box.

You basically have two ways


1) In the controlsource of the image box added  cboProdName.[Column](3)

or

Me.imgImage.Picture = Me.cboProdName.Column(3)

Make sure that column 3 of the combo box has the full path of the image
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SteveL13Author Commented:
1 didn't do anything.
2 gave me an error ...  Object doesn't support this property or method.
0
 
SteveL13Author Commented:
By the way... image is an attachment in the table that the query feeding the combobox uses.
0
 
SheilsCommented:
It will not work if the image are saved in the table. I strongly advise against storing images in tables because it will make you database unnecessarily large and eventually slow it down significantly. You are better of storing the image in a folder and storing only the image path in the table. The one the image box set the picture type as linked
0
 
SteveL13Author Commented:
Ok.  I understand I am going to award this topic and post another one titled, "How populate image on a form from a hyperlink on the same form?"

--Steve
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now