Can't figure out why EVAL isn't.
My form has detail section named Detail containing a text box named
MyTextControl.
Using properties window
Detail.OnMouseMove is set to =OverAndOut("Detail")
MyTextControl.OnMouseMove is set to =OverAndOut("MyTextControl")
Over and Out is coded as such:
'====================================
Dim ControlNameMouseOver As String
Function OverAndOut(ControlName As String)
Dim OutFunction As String
Dim OverFunction As String
Dim rc As Integer
If ControlName <> ControlNameMouseOver Then
OutFunction = ControlNameMouseOver & "_MouseOut()"
On Error Resume Next
rc = Eval(OutFunction)
ControlNameMouseOver = ControlName
OverFunction = ControlNameMouseOver & "_MouseOver()"
rc = Eval(OverFunction)
End If
End Function
Function MyTextControl_MouseOver() As Long
MsgBox ("Over happened")
End Function
Function MyTextControl_MouseOut() As Long
MsgBox ("Out happened")
End Function
'====================================
The OverAndOut code runs, but neither MyTextControl_MouseOver nor
MyTextControl_MouseOut runs.
Any reason why?
TIA,
Richard
Richard - 01 Feb 2007 05:05 GMT
> Can't figure out why EVAL isn't.
>
[quoted text clipped - 43 lines]
> TIA,
> Richard
It appears that a NameSpace is needed
NameSpace = "Forms!" & "[" & Me.Name & "]."
OutFunction = NameSpace & ControlNameMouseOver & "_MouseOut()"
OverFunction = NameSpace & ControlNameMouseOver & "_MouseOver()"