Display data in a field using the controltip text property?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to display the full data field when the mouse curser moves
over the field? The controltip text property cannot display the actual data.
 
The example below will display the value in a label. You can use
DoCmd.RunCommand acCmdZoomBox to display the data in the same dialog you get
when you press Shift+F2, but you don't want to do that in the MouseMove
event procedure, as the *previous* control still has the focus at that
stage. You can do it in the DoubleClick event procedure, though - see the
second example below ...

Private Sub Address_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)

'Check first to avoid flicker.
If Me.lblStatus.Caption <> Me.Address.Value Then
Me.lblStatus.Caption = Me.Address.Value
End If

End Sub

Private Sub Address_DblClick(Cancel As Integer)

DoCmd.RunCommand acCmdZoomBox

End Sub

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
BTW: I had no success trying to do this with the ControlTipText property.
You can set the property equal to the Value property, sure, but when I added
the code to the MouseMove event procedure, the Control Tip was never shown.
You could try Stephen Leban's ToolTip class instead ...

http://www.lebans.com/tooltip.htm

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top