mouse hover event

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

Guest

I'd like to display some pop up information to a user when the mouse "hovers"
over a text box. I'd also like the information to disappear when the user
moves the mouse. I haven't done this in access before. I can imagine
something like a mouseover event with a timer.

Thank you
 
Tim said:
I'd like to display some pop up information to a user when the mouse
"hovers" over a text box. I'd also like the information to disappear
when the user moves the mouse. I haven't done this in access before.
I can imagine something like a mouseover event with a timer.

Thank you

Access controls have this built in. Look for the ControlTip Text property.
 
Thanks Rick. I should have been more clear. For the information I need to
display I will have to execute some code to look up info from a table based
on the info in that particular text box control. I will have to use this
same function on 200+ text box controls on this form.

Thanks again !!!

t.
 
Tim said:
Thanks Rick. I should have been more clear. For the information I
need to display I will have to execute some code to look up info from
a table based on the info in that particular text box control. I
will have to use this same function on 200+ text box controls on this
form.

Access forms don't have the nice MouseOver and MouseOff event that web pages do.
They have MouseMove instead. The difference (and problem) is that it fires
constantly, once for every pixel change of the mouse while you are over the
control, not just once moving over the control.

Since it is rare that one would actually want their code to fire continuously
like that you have to put hacks in to try to limit the code to running only once
until the mouse cursor leaves the control while still running again should the
cursor return. In my experience this is difficult to achieve without a lot of
problems and/or screen flicker.

Stephen Lebans (I think) has an advanced mouse-over example that you might want
to look at for ideas.
 
There is no reason you couldn't use a single function for all the text boxes.
Just pass the name of the control to the function and use it to determine
what text you need:

Private Function SetText(strCtlName As String) As Boolean
Dim ctl As Control
Dim strText as String

Set ctl = Me.Controls(strCtlName)

strText = 'Do the logic to select the text

ctl.ControlTipText = strText
End Function
 
Thinking out loud. Is it possible to programatically define the
controltip.text property during the formload event? That could end up being
the way to go for me because all of the text boxes are filled out for the
user during the load.

t.
 
Yes, see my previous post.

Tim A said:
Thinking out loud. Is it possible to programatically define the
controltip.text property during the formload event? That could end up being
the way to go for me because all of the text boxes are filled out for the
user during the load.

t.
 
This should work. I can set all the text box control tips during formload
using the syntax you provided. Thank you!

t.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top