Mouse Move

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

Guest

I have a form where I've had to size certain Textboxes which truncates info
from view. I want to use the MouseMove (similar to a Tool Tip) event to
display the entire info.

I've thought of opening a form with its contents but wondered if anyone
knows of a slicker way to get the info to display.

TIA... You folks have been great!
 
Where would you want to "display the entire info"? Do you want to
temporarily expand the text box or do you have another place on the form to
display the info?
 
Someone might have a better piece of code that doesn't just ignore errors.
Add a function to the form's module:
Function MouseOver(pstrLabel As String)
Dim ctl As Control
Static strCtl As String
Static intPrevWidth As Integer
On Error Resume Next
If pstrLabel = "form" Then
Me(strCtl).Width = intPrevWidth
strCtl = pstrLabel
Else
If pstrLabel <> strCtl Then
Me(strCtl).Width = intPrevWidth
intPrevWidth = Me(pstrLabel).Width
Me(pstrLabel).Width = 1440
strCtl = pstrLabel
End If
End If
End Function
Label controls must not be a child of another control. Set the Mouse Move
property of each label control to something like:
=MouseOver("Label0")
Set the Mouse Move event property of the detail section of the form to:
=MouseOver("Form")

View the form and mouse around to test.
 
Most Excellent, Duane.... Thank you very much!

Duane Hookom said:
Someone might have a better piece of code that doesn't just ignore errors.
Add a function to the form's module:
Function MouseOver(pstrLabel As String)
Dim ctl As Control
Static strCtl As String
Static intPrevWidth As Integer
On Error Resume Next
If pstrLabel = "form" Then
Me(strCtl).Width = intPrevWidth
strCtl = pstrLabel
Else
If pstrLabel <> strCtl Then
Me(strCtl).Width = intPrevWidth
intPrevWidth = Me(pstrLabel).Width
Me(pstrLabel).Width = 1440
strCtl = pstrLabel
End If
End If
End Function
Label controls must not be a child of another control. Set the Mouse Move
property of each label control to something like:
=MouseOver("Label0")
Set the Mouse Move event property of the detail section of the form to:
=MouseOver("Form")

View the form and mouse around to test.
 
I'm getting an "Invalid use of Me keyword". Is there a particular reference I
should be loading? Using Access 2k
 
The code should be in the form module. If your code still errors, make sure
you don't have your general settings in the modules to break on all errors.
 
When you say the label controls must not be a child of another control I
suppose that means this routine won't work in a subform (actually a
sub-subform).
 
Back
Top