Full Version: My controltip text is getting a too long error , how can i chang
UtterAccess Forums > Microsoft® Access > Access Forms
I have a transparent command button over my label which triggers on the move mouse event.
The code is as follows.
Private Sub Command47_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Command47.ControlTipText = DLookup("Tier", "tbltier", "TierID = 1")
End Sub

The tier field in the table is a memo field as I want to show an example of what the label means in the tip text but I am getting an error saying it is too long . Is there a way I can change the size of the tip text field or is there another way to show what I want?
please advise.
Use the Left() function to trim down your value ... Maybe something like this:
Private Sub Command47_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim strTip As String
    strTip = DLookup("Tier", "tbltier", "TierID = 1") & ""
    If Len(strTip) > 50 Then
        strTip = Left(strTip, 47) & "..."
        strTip = Left(strTip, 50)
    End If
    Me.Command47.ControlTipText =  strTip
End Sub
ControlTipText is limited to 255 characters displayed. This is not a changable parameter.
If you want longer "Tips" displayed, you'll have to develop your own code to create the tip boxes.
Is the full text of the Tier field in a text box control on the form? ... So... in other words, were you trying to show the full text of a partially displayed field? ... if so, you can easily set up a dbl-click event to Zoom the control can show the full text ... I have a function that looks like this:
Public Function ZoomValue(ctl As Control) As Byte
'Zooms the value of the passed control.  Great for long text fields
    'On Error GoTo ErrorHandler
    DoCmd.RunCommand acCmdZoomBox
End Function

Then in the dbl-click event PROPERTY (not the event code) of the text box that holds my MEMO or long text field, I call the function with the following input in that property ...
This is great because the zoombox is Access's zoom box and thus allows the user to edit the fields contents right in the zoom box, if edits are allowed, the changes are sent back to the passed control ... with no code!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.