Hi,
I have a piece of code to display a picture in an Access Form. Here's the code:
The problem is if a picture for a particular unit is unavailable, it will show error 2220 unable to open (of course, because the file does not exist). What I want is if that happen, instead of spitting out error message, it will replace the pics with rduck.jpg (as in ELSE clause). Any help? Thanks!
I have a piece of code to display a picture in an Access Form. Here's the code:
Code:
Dim UnitID As String
UnitID= Me.UnitID.Value
If IsNull(UnitID) = False Then
Me.ImageBox.Picture = "E:\User\USER\Database\Unit Pics\" & UnitID & ".png"
Else
Me.ImageBox.Picture = "E:\User\USER\Database\Unit Pics\rduck.jpg"
End If
ListUnitPart.Requery
The problem is if a picture for a particular unit is unavailable, it will show error 2220 unable to open (of course, because the file does not exist). What I want is if that happen, instead of spitting out error message, it will replace the pics with rduck.jpg (as in ELSE clause). Any help? Thanks!