I have a form that has a textbox containg a path. I also have an image that displays the picture referenced by the path textbox.
All works well until someone deletes the image, without updating the path. This produces error "2220" "Can't open file C:\blah\blah"
I would like to set the path to null if the path is invalid and tell the user to re-associate the picture.
I have tried the following with no luck:
Thanks for any suggestions.
All works well until someone deletes the image, without updating the path. This produces error "2220" "Can't open file C:\blah\blah"
I would like to set the path to null if the path is invalid and tell the user to re-associate the picture.
I have tried the following with no luck:
Code:
Private Sub Form_Current()
'Show imbedded "nopic photo" if the path is null
If IsNull(Me.path) Then
Me.NOPIC.Visible = True
Me.pic.Visible = False
Else
'Show linked image from PATH field
Me.NOPIC.Visible = False
Me.pic.Visible = True
End If
If error = "2220" then
msgbox "The existing picture has been removed, please associate a new photo", vbOKOnly, "Invalid Picture"
Docmd.RunSql "Update Client set Path = Null"
End if
End Sub
Thanks for any suggestions.