Showing Picture on a UserForm after inserting ID

rlill

New Member
Joined
Mar 5, 2016
Messages
16
Hello

I m trying to create a user friendly database. Now I am stuck and I need help
smile.gif

I have a userform whrere you can insert a product ID (artkli number) and then it shows all the information about that product (fills all the blue blocks).
But my problem is that I want it to show me a picture about that product too in a imagebox below. Is it doable and how?
449432d1457168512-showing-picture-on-a-userform-after-inserting-id-userform.jpg

Code i have now:
Private Sub cmdClose_Click()
'Sule programm
Unload Me

End Sub

Private Sub CmdReset_Click()

Unload frmLookup
frmLookup.Show

End Sub

Private Sub cmdSend_Click()
'Loo muutujad
Dim cNum As Integer
Dim X As Integer
Dim nextrow As Range

'Lisa andmekastikeste arv
cNum = 15
Set nextrow = Sheet3.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
For X = 1 To cNum
nextrow = Me.Controls("Reg" & X).Value
Set nextrow = nextrow.Offset(0, 1)
Next
MsgBox "Andmed on lisatud Tootmistabelisse."
'Kustuta kastikeste sisu
cNum = 15
For X = 1 To cNum
Me.Controls("Reg" & X).Value = ""
Set nextrow = nextrow.Offset(0, 1)
Next
End Sub



Private Sub Reg1_AfterUpdate()
'Kontrolli kas see vaartus on olemas
If WorksheetFunction.CountIf(Sheet2.Range("A:A"), Me.Reg1.Value) = 0 Then
MsgBox "See toode ei ole lisatud andmebaasi."
Me.Reg1.Value = ""
Exit Sub
End If
'Lookup vaartused pohinedes esimesele reale
With Me
.Reg2 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 2, 0)
.Reg3 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 3, 0)
.Reg4 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 4, 0)
.Reg5 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 5, 0)
.Reg6 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 6, 0)
.Reg7 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 7, 0)
.Reg8 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 8, 0)
.Reg9 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 9, 0)
.Reg10 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 10, 0)
.Reg11 = Application.WorksheetFunction.VLookup(CStr(Me.Reg1), Sheet2.Range("Lookup"), 11, 0)

End With
End Sub


Private Sub UserForm_Click()

End Sub

Raigo
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Sure it's doable. U need an image control on the userform, a folder of pics and a list in XL of the file names. If you named the pics to correspond with the product name then no file list would be required. When U enter the product ID then load the image control with the appropriate file. HTH. Dave
 
Upvote 0

Forum statistics

Threads
1,215,373
Messages
6,124,559
Members
449,171
Latest member
jominadeo

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