Results 1 to 3 of 3

Thread: ControlTip Text

  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: ControlTip Text

    Is there a way to get Access 2002 to assign the contents of a field for the record you are hovering your mouse over (not necessarily the field with the focus) to ControlTipText on a continuous form? I know you use something like this:

    Code:
    Dim strCTT As String
    
    strCTT = txtAddress
    txtAddress.ControlTipText = strCTT
    But how to assign it to the field the mouse is hovering over, rather than the field with the focus?

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    Add you code to the Form_Current()

    That means when a record is display the on Form_Current() will be exe

    Off the top of head not a i'm not a home

    You should be able to to this

    Code:
    Dim ctl As Control
    Set ctl = Screen.ActiveControl
    
    For Each ctl In Me.[Screen_Name].Controls
    If ctl.ControlType = acTextBox then
    ctl.ControlTipText = ctl.VALUE ' or ctl.text <= can't remeber which 1 
    end if
    next
    That should loop all controls and add the value to the controltiptext
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    Thanks for the reply. I tried your code, but the ControlTipText only shows the contents of the field for the first record, regardless of which record I hover the mouse over, and regardless of which record has the focus. I tried changing your code to this:

    Code:
    On Error Resume Next
        Dim ctl As Control
        Set ctl = Screen.ActiveControl
    
        For Each ctl In Forms![Bad Faults].Controls
            If ctl.ControlType = acTextBox And ctl.Name = "NoteLineX" Then
                ctl.ControlTipText = ctl.Value
            End If
        Next
    This will now assign the contents of the current field with the focus to ControlTipText (as my original example did), but I need ControlTipText to show the contents of the field that the mouse hovers over, not the field that has the focus. Any other ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •