No problems Slen. What with weekends, holidays, & time zones, forums aren't the fastest way to communicate.
I want to learn how to use a Form as a Function, returning a value to the calling statement. I also want to use MsgBox with a CheckBox to "...not show this message again". This would allow me to use errors to teach use of a project with many errors caught, and as the operator learns, the warnings can be suppressed. So that is what I am trying to do.
To make my MsgBox similar to the familar M$ MsgBox, I want to add those icons that M$ uses, the ?, !, i, X. I can't find them in my computer, so I created them on the Desktop and called them Icon1.jpg, Icon2.jpg, Icon3.jpg, and Icon4.jpg. There could be more in the future. They are about 2K bytes each, no big deal. Then I created imgLevel1 and set .Picture to C:\Desktop\Icon1.jpg and .PictureType to Embedded. Same for imgLevel2, imgLevel3, and imgLevel4.
Code should be simple:
- Select Case iLevel
-
Case 1
-
imgShowLevel.Picture = imgLevel1.Picture
-
Case 2
-
imgShowLevel.Picture = imgLevel2.Picture
-
...
-
End Select
If the images still reside on the Desktop, the code works. But because I should no longer need these, I removed them from the Desktop, and the program errors, "Run-time error '2220': Microsoft Office Access can't open the file 'C:\Desktop\Icon1.jpg'."
There are work-a-rounds, sure. What comes to mind is to stack the permanent images in design view, and display the correct image with the .Visible Property at Run Time. If iLevel is 2, for example (see code above), then Case 2 would be:
If this is the way to go, so be it. Either the controls have to be stacked, and therefore more difficult to work with in design view, or the form must stack them when Opened at Run Time.
Thank you for your attention !