Forms and Pictures

ALEXAA

New member
Local time
Today, 09:43
Joined
Nov 29, 2001
Messages
5
Hello everyone!. This is my situation, I have a "Main Menu" Form that has several command buttons with the Transparent property ON and Label on the back of each command button. You can select on option with either the arrow keys and enter, by pressing the ALT key and the underscore Letter and by a Click of the mouse over the command button, in this last case I have hyperlink the command button to go to each option selected, So when you move the mouse to any command button I put code so the label behind the command button changes color on Got Focus and Lost Focus. All that works perfectly, so since I put all the buttons on the left side of the form vertically, I want to put on the right of the form a Picture (Image Object) of the option form to be selected, that is that what ever command button option has the focus, the Image Picture will change with along with the command button, that works fine if I do it with the arrow keys and if I do it slowly with the mouse pointer it works fine, but if I move it quickly from one command to another it sends me this message error:

Msaccess
This program has performed an illegal operation and will be shut down.
If the problem persist, contact the program vendor.

The code that I use with each command button is this:

Private Sub Command116_GotFocus()
'Image152.SpecialEffect = 2
Label183.SpecialEffect = 2
Label183.BackColor = 16310466
Label183.ForeColor = 0

ImagePath = "C:\My Documents\Desigs\PICTURES\Command116.jpg"
Me!Image10.Picture = ImagePath
Me!Image10.SizeMode = acOLESizeZoom
Me.Refresh
End Sub

Private Sub Command116_LostFocus()
'Image152.SpecialEffect = 1
'Image152.SpecialEffect = 0
Label183.SpecialEffect = 1
Label183.BackColor = 8388608
Label183.ForeColor = 16777215

ImagePath = ""
Me.Refresh
End Sub

So I after all that I hope some one can help to correct the problem or maybe give another idea . . .
 

Users who are viewing this thread

Back
Top Bottom