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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO LOAD A DEFAULT IMAGE IF IMAGE FILE DOES NOT EXIST 1

Status
Not open for further replies.

Lightningfast

Technical User
Jul 27, 2002
18
AU
I have a form linked to an image file but I need a way to return a default error file if the requested file does not exist
eg: this code leaves the last image in place
On Error Resume Next
If Not IsNull(Me![imageafter]) Then
Me![pictureimage].picture = Me![imageafter]
End If

Thanks in anticipation TP
 
Something like:

Sub Form_Current()
On Error GoTo ErrHandler
PictureImage.Picture = Me("imageafter")
Finish:
Exit Sub

ErrHandler:
PictureImage.Picture = "C:\Path\ErrorImageFile.jpg"
Resume Finish
End Sub

Good luck

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Thanks Daniel,
Thats exactly what I needed the right syntax. Had to massage it a bit but it works just fine now. Thanks from Down Under, Trevor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top