Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Images Question

Status
Not open for further replies.

jgonick

Technical User
Mar 5, 2002
23
US
Ithe OnFormat of your details sections I used:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull([ImagePath]) Then
Me![ImageFrame].Properties("Picture") = "./NotAvailable.jpg"
Else
Me![ImageFrame].Properties("Picture") = _
Me![ImagePath]
End If
End Sub

This works great if the ImagePath is null or a valid file. Is there a simple solution to make it display the not availabe image if the file is not valid.(If the image file doesn't exist anymore. --If it was moved or deleted.)
 
You can
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull([ImagePath]) Or _
Len(Dir(Nz(Me.ImagePath,"zz")))= 0 Then
Me![ImageFrame].Properties("Picture") = "./NotAvailable.jpg"
Else
Me![ImageFrame].Properties("Picture")
End If
End Sub



Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top