Images on Forms (1 Viewer)

rghaddad@inco.com.lb

Registered User.
Local time
Today, 23:35
Joined
Dec 5, 2013
Messages
16
Hello All,
Below is a Macro I wrote assigning a picture to an image box on a form.
it worked properly then stopped for no reason.
it is now generating runtime-error 2220

============================================

Private Sub Combo45_Change()
'This is the By Part Reference ComboBox
Dim SelectedPartName As Variant

If Not IsNull(DLookup("[PartPicture]", "Table_Stock", _
"[PartName]=[Forms]![Form_By_Products]![combo45]")) Then

SelectedPartName = DLookup("[PartPicture]", "Table_Stock", "[PartName]=[Forms]![Form_By_Products]![combo45]")

MsgBox ("Selected Part: " & SelectedPartName)
' On Error Resume Next
Image22.Picture = SelectedPartName
Else
MsgBox "No Image"
Image22.Picture = ""
End If
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:35
Joined
May 7, 2009
Messages
19,169
i am guessing [PartPicture] field holds the Path+PictureName.
see if the picture actually exists.
 

rghaddad@inco.com.lb

Registered User.
Local time
Today, 23:35
Joined
Dec 5, 2013
Messages
16
indeed
attached is the reference table / table field
 

Attachments

  • C__Users_rgh_Dropbox_Roland_Databases_Spa.png
    C__Users_rgh_Dropbox_Roland_Databases_Spa.png
    61.3 KB · Views: 108

Users who are viewing this thread

Top Bottom