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