Text-box tooltips to show when hovering mouse over field?

BadBoy House

Registered User.
Local time
Today, 19:13
Joined
Oct 8, 2009
Messages
54
Hi all.

I have a text box on a form which allows users to enter comments in to a record. The field is a standard short-text field but I was wondering if there is any way to configure the field on the form so that if the user hovers their mouse over it then it would display the entire contents of the field?

This way it would mean that we could have the text box at a normal size instead of increasing its length to accommodate long comments.

Hope that makes sense!

thanks
 
in the ON CURRENT event for the form,
Code:
sub form_Current()
  txtNotes.ControlTipText  = txtNotes
end sub
 
For the text boxes/fields where they already have some text in that works perfectly, however when I click in to empty text boxes to enter some comments I get:

Run-time error 94
Invalid use of Null
 
For the text boxes/fields where they already have some text in that works perfectly, however when I click in to empty text boxes to enter some comments I get:

Run-time error 94
Invalid use of Null

Test to see if there is anything to display first?
 
Or use the Nz() function...
 
Thanks a lot for the replies. Much appreciated.

I'm not familiar on how to test if there is anything to display first or the Nz() function - any pointers on how to do these?

We would need to be able to either hover the mouse over the field if there is some text in it already, or be able to click in the text box to enter text into the field.
 
Thanks a lot for the replies. Much appreciated.

I'm not familiar on how to test if there is anything to display first or the Nz() function - any pointers on how to do these?

We would need to be able to either hover the mouse over the field if there is some text in it already, or be able to click in the text box to enter text into the field.
Hi. To test if it's empty, you could try the following:
Code:
Private Sub Form_Current()
    If IsNull(Me.txtNotes) Then
        Me.txtNotes.ControlTipText = ""
    Else

        Me.txtNotes.ControlTipText = Me.txtNotes
    End If
End Sub
And to use the Nz() function, you could try:
Code:
Private Sub Form_Current()
    Me.txtNotes.ControlTipText = Nz(Me.txtNotes,"")
End Sub
Hope it helps...
 
Something along the lines of

Code:
If Len(txtNotes) & "" > 0 then
    txtNotes.ControlTipText  = txtNotes
End If

or
Code:
txtNotes.ControlTipText  = NZ(txtNotes,"")

You could perhaps also use the MouseMove event of the control instead I believe.?
 
Hi. To test if it's empty, you could try the following:
Code:
Private Sub Form_Current()
    If IsNull(Me.txtNotes) Then
        Me.txtNotes.ControlTipText = ""
    Else

        Me.txtNotes.ControlTipText = Me.txtNotes
    End If
End Sub

Thanks @DBGuy

This code works perfectly!

:)
 
Hi. You're welcome. We were all happy to assist. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom