Load info and photo from combobox choice

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,232
Office Version
  1. 2007
Platform
  1. Windows
Merry Christmas to you all,
Upon making a selection choice from a combobox list ive got it to fill cells with the correct info but need an image to also be shown in the Imagebox.

The data being entered into a specific cell is also the same name as the Image.
So if i select from the combobox xyz then this is shown in my text box,i also need the matching image also called xyz to be shown in the ImageBox.

Any advise please.

Thanks
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Morning all,

I have now got the code working fine but i would like to ask for a closing piece of code if i may.
The below code supplied is in use and working fine for me but a msg box if needed should a photo not be located in the folder where photos are stored.

Example.
I make combobox selection of say HU64,
Text boxes are then filled with info for HU64.
Textbox10 shows HU64.
The image1 box also shows a photo of HU64

BUT
If i were to then select say NSN14 from the combobox & all textboxes were filled with the relevant info but no photo was found i would either like a msg box or a photo to load in the Imagebox saying NO PHOTO FOUND.

Currently what is happening is that no photo is found and the previous photo is still shown,so NSN14 was selected BUT HU64 photo is shown from previous load.

Code:
Private Sub TextBox10_Change()If Me.TextBox10.Value = "HU 64" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU64.jpg")
ElseIf Me.TextBox10.Value = "HU 66 GEN 1" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU66.jpg")
ElseIf Me.TextBox10.Value = "HU 66 GEN 2 " Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU66.jpg")
ElseIf Me.TextBox10.Value = "HU 66 GEN 3" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU66.jpg")
ElseIf Me.TextBox10.Value = "HU 92" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU92.jpg")
ElseIf Me.TextBox10.Value = "HU 100" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU100.jpg")
ElseIf Me.TextBox10.Value = "HU 101" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\HU101.jpg")
ElseIf Me.TextBox10.Value = "NSN 14" Then
Image1.Picture = LoadPicture("C:\PICKING PHOTOS\NSN14.jpg")
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,471
Messages
6,125,000
Members
449,202
Latest member
Pertotal

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top