I have a form where I want an image to show after I click a command button.
The image path is linked in code in an On Click Event of the command button:
Me.imgPic.Picture = "Cocuments and SettingsRmpaleoMy DocumentsPaleo_LocalitiesImages" & Me.[Loc_Number] & ".jpg"
This pulls a jpeg from a folder stored with Access database.
I have two questions-
1. When I open the database, no images are shown (good!). When I click on the command button, the appropriate image is shown (good!). But if I move to or create a new record (after I have opened an image in a previous record) the previous record's image is shown. If I then click on the command button, the appropriate image is shown for the new record (good!). So, the button works, but I need it to either refresh with the new image when I change records or clear the image (so the user has to click on the button). I would prefer that the image was cleared (command cancelled). How?
2. Not every record has an image, so I get an error message that it can't find the file (understandably). How can I avoid this?
Ok-I have three: do I need to reference others in my database if I use their code? Where and how?
I'm using HansV's code from the "Link to Images (2000) posts (283145) on August 10-11, 2003. They were very helpful getting me this far. Thank you, HansV!
I'm using this method because the path will change when we get a new server, and I want the images linked-not embedded.
I am learning as I go, so I know just enough to get me in trouble. Code is new to me, so be gentle.
Thank you for your time,