Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Issue--unable to debug

Status
Not open for further replies.

NumberCrunchingMonky

Technical User
Feb 5, 2004
30
US
I have some script that changes the visual effect of three buttons upon mouse-over, but the 7th line from the bottom highlights yellow during the event, indicating an issue. I do not know what is causing this.

Here's the line:
Set OleObj = Me.OLEObjects("Label" & i)

Here's the script in full:

Private Sub commandbutton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Normalize
Label1.BackColor = 16777164
Label1.SpecialEffect = fmSpecialEffectSunken
'Do whatever else . . .
End Sub
Private Sub commandbutton2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Normalize
Label2.BackColor = 16777164
Label2.SpecialEffect = fmSpecialEffectSunken
'Do whatever else . . .
End Sub
Private Sub commandbutton3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Normalize
Label3.BackColor = 16777164
Label3.SpecialEffect = fmSpecialEffectSunken
'Do whatever else . . .
End Sub
Private Sub Normalize()
Dim i As Long, OleObj As OLEObject
For i = 1 To 3
Set OleObj = Me.OLEObjects("Label" & i)
With OleObj.Object
.SpecialEffect = fmSpecialEffectRaised
.BackColor = vbMenuBar
End With
Next
End Sub

Thanks for your help.
NCM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top