(Q) How can I create a OnMouseOver effect on Access forms?
(A) The equivalent Access form event is OnMouseMove. We can
call a function to show the desired effect and then from the surrounding section's
OnMouseMove event, call a function to remove the effect.
For each label on a form, place a call to function fSetFontBold
from their OnMouseMove event and pass the label's name as an argument to the function.
[OnMouseMove] = fSetFontBold("lblThisLabel")
From the OnMouseMove event of the surrounding detail section, call the function
fRemoveFontBold.
[OnMouseMove] = fRemoveFontBold()
Create a form level variable.
Dim mstPrevControl As String
Function fSetFontBold(stControlName As String)
Const cBold = 700
Const cNormal = 400
On Error Resume Next
With Me(mstPrevControl)
.FontWeight = cNormal
.ForeColor = 1279872587
End With
mstPrevControl = stControlName
With Me(stControlName)
.FontWeight = cBold
.ForeColor = 0
End With
End Function
Function fRemoveFontBold()
Const cNormal = 400
On Error Resume Next
With Me(mstPrevControl)
.FontWeight = cNormal
.ForeColor = 1279872587
End With
End Function
|