Results 1 to 2 of 2
  1. #1
    trb5016 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Location
    Pennsylvania
    Posts
    71

    Any change of focus on form Event?


    I have a box on my form where I want to display very visible tool tips on what a field means. I have a table that stores the tip on the same row as the field name. This way I can easily pull a tip for a specific field by determining what control has focus then doing a DLookup to pull what text should go in the "Help Box"

    Right now, I can do this by having 2 events for each field control. I use the field_GotFocus event to set the Help Box text, and the field_LostFocus event to clear the box.

    Code:
    Private Sub StartDate_GotFocus()
    
        HelpBox.Value = Nz(DLookup("txt_Tip", "DB_Field_Tips", "[txt_Field Name]='" & Screen.ActiveControl.Name & "'"), "")
    
    End Sub
    
    Private Sub StartDate_LostFocus()
        
        HelpBox.Value = ""
        
    End Sub
    Since its using the active screen control and not a hard coded field name I was wondering if there was any way I could have the scripts run without creating two subs for every control on the field.

    Any Ideas? The Form Got/Lost Focus, as far as I can tell does not fire when jumping from one field to the next via Tabbing or mouse click.

    I feel like I could use a "On Mouse Click" and "On Key Press=Tab" event but that seems really sloppy

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It sounds like you have done your own ToolTips. Have you seen this: http://www.lebans.com/tooltip.htm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. User focus control in AfterUpdate event
    By nosliwmada@gmailcom in forum Programming
    Replies: 3
    Last Post: 12-20-2010, 12:51 PM
  2. Using an event to change color of text.
    By michaeljohnh in forum Programming
    Replies: 3
    Last Post: 08-30-2010, 12:30 PM
  3. Replies: 3
    Last Post: 02-19-2010, 04:19 PM
  4. Replies: 3
    Last Post: 10-18-2009, 09:17 AM
  5. Replies: 2
    Last Post: 03-10-2009, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums