Hi Tara,
Well first off a label can never receive focus in the VBA sense so I'm
assuming you mean "when the mouse passes over this label change the font to
bold and then back to normal when you move the mouse away." Is this correct?
If so you need two events: one for the label itself and one for the detail
section (assuming this label is actually in the form's detail section).
This works for me:
Private Sub lblMyLabel_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblMyLabel.FontBold = True
End Sub
Now to change it back to normal we need this code in the detail section:
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblMyLabel.FontBold = False
End Sub
Passing the mouse over the label causes the font to go to bold and then
moving it away changes it back to normal. (You will have to use your own
label name of course)
HOWEVER, this will only work on unattached labels! I just recently found
this out from Dirk "Yoda" Goldgar. If you look at the Properties list for an
attached label there is no MouseMove event so the best thing is to just cut
it from the form, then paste it back on, and finally re-position it to where
you would like.
Hope that helps,
Jeff Conrad
Bend, Oregon