dsfcom
Registered User.
- Local time
- Today, 05:11
- Joined
- Mar 13, 2007
- Messages
- 72
Hello. I've searched and read a few threads concerning image controls on forms and haven't been able to find a solution to my problem (yet). Anyway, I have a form with two image controls (imgOK1 & imgOK2). The previous and current setting of the "Picture" property for both images is set to "C:\MOM\Graphics\filename.bmp". The location of my images has changed and will change for each user which is "C:\Documents and Settings\user.name\MOM\Graphics\filename.bmp". I'm using the following code to set the .Picture property on form load:
When the form is opened, an error stating that the image located at "C:\MOM\Graphics\filename.bmp" cannot be found; once for each image control. Then the form loads and .Picture properties appear to be set correctly as they are displayed fine. I've tried to clear the .Picture properties for both image controls using the properties editor but the original path returns as soon as the property loses focus. Is there a way to programatically set this property and make it stick so the errors are not displayed?
Code:
Dim ImgPath
ImgPath = "C:\Documents and Settings\" & Environ("username") & "\My Documents\MOM\Graphics\"
Me.imgOK1.Picture = ImgPath & "imgButton-OK1_25%.bmp"
Me.imgOK2.Picture = ImgPath & "imgButton-OK2_25%.bmp"
When the form is opened, an error stating that the image located at "C:\MOM\Graphics\filename.bmp" cannot be found; once for each image control. Then the form loads and .Picture properties appear to be set correctly as they are displayed fine. I've tried to clear the .Picture properties for both image controls using the properties editor but the original path returns as soon as the property loses focus. Is there a way to programatically set this property and make it stick so the errors are not displayed?