H
Hyun Yu
On my form, I have embedded a picture (a blank image) and have coded the
following event procedure to change the picture according to the value of
two fields ("Manufacturer" and "Part_No") in the database:
-------------------------------------
Private Sub Form_Open(Cancel As Integer)
On Error Resume Next
Me.Photo.Picture = "D:\Data\Catalog Photos\" & Me.Manufacturer & "_" &
Me.Part_No & ".jpg"
End Sub
-------------------------------------
The same code is in place for Private Sub Form_Current(), Private Sub
Manufacturer_AfterUpdate(), and Private Sub Part_No_AfterUpdate().
It works fine, except that when a record is accessed that does not have the
"Manufacturer" and/or "Part_No" fields populated, in which case the image
from the previous record is displayed. I'd like to have the form display
the blank image that was originally embedded to the form when a record with
missing info on those fields is accessed.
Is there an easy way to code this?
Thanks for any help.
following event procedure to change the picture according to the value of
two fields ("Manufacturer" and "Part_No") in the database:
-------------------------------------
Private Sub Form_Open(Cancel As Integer)
On Error Resume Next
Me.Photo.Picture = "D:\Data\Catalog Photos\" & Me.Manufacturer & "_" &
Me.Part_No & ".jpg"
End Sub
-------------------------------------
The same code is in place for Private Sub Form_Current(), Private Sub
Manufacturer_AfterUpdate(), and Private Sub Part_No_AfterUpdate().
It works fine, except that when a record is accessed that does not have the
"Manufacturer" and/or "Part_No" fields populated, in which case the image
from the previous record is displayed. I'd like to have the form display
the blank image that was originally embedded to the form when a record with
missing info on those fields is accessed.
Is there an easy way to code this?
Thanks for any help.