Listbox and images

  • Thread starter Thread starter bhavtosh.sharma
  • Start date Start date
B

bhavtosh.sharma

hi im facing a problem in working with listbox and images. can anyone
tell me how to include images and link them with listbox entry so that
when user clicks any item then particular linked image should come in
image control. any help wud be highly appreciated.

thanx
sharma
 
Hi,
Well, whatever table contains the info for your listbox entry would also have a
field with the path to an image on your hard drive. Then you simply load the image
associated with the entry.
 
you need to have the image's filepath in the table with
the records. then when you select the item in the list
box, code would chage the image control'spicture property
to the new file path of the new item.
 
sorry. use code like this
Me.Imagecontrol.Picture = DLookup
("[filepath]", "Atable", "[id] ='" & Me.ListBox0 & "'")
 
Back
Top