maybe a simpler way:
enter the following code in the form module
Code:
Function PassName()
Dim ctl As Control
For Each ctl In Forms!frmFormName.Controls
If ctl.ControlType = acTextBox Then
ctl.OnMouseMove = "=MyFunc(""" & ctl.Name & """)"
End If
Next
End Function
Public Function MyFunc(strControlName As String)
MsgBox strControlName
End Function
In design view, select all the controls involved and enter = PassName() for the mouse move event. Compile & Save. Switch to form view and test. Works for me. Obviously you will want to do something other than have a message box.
Wish I could take credit, but I got it from an Allen Browne reply. I love the idea of reassigning the mouse move event on the fly.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.