The reason the form is flickering is because I have written a generic function that loops through all of the controls on the form and re-sets the forecolor and mouse pointer depending on whether or not the cursor is over the control passed to the function as an argument. Here is the code:
Option Compare Database
Private ctlOver As Control
Function LoopCntrls(Optional ctlNameIn As String)
For Each ctlOver In Me.Controls
If IsNull(ctlNameIn) Or ctlNameIn = "" Then
ctlOver.FontUnderline = False
ctlOver.ForeColor = "0"
Screen.MousePointer = "0"
ElseIf ctlNameIn = ctlOver.Name Then
ctlOver.FontUnderline = True
ctlOver.ForeColor = "16737843"
Screen.MousePointer = "1"
Else
ctlOver.ForeColor = "0"
End If
Next ctlOver
End Function
Therefore it is the constant looping that is causing the flickering. Because the code is triggered by the mousemove event, it is running more or less all of the time.
I can't think of another way of doing this that achieves the same result.
Ideally I would like to just change the mousepointer to the pointing finger when it moves over text boxes. This is easily done with command buttons, labels etc but not text boxes.
Let me know if you have any ideas.