Ok here's my situation.. I have a super simple form, which is bound to a table with a single record. All the controls (mostly text boxes, some true/false checkboxes and combos) are bound straight to each field.
Now, in the table itself, each field has it's Description property filled out, instructing the user as to what data belongs in the field. I can pull this data on the form by using each control's .StatusBarText property. What I'd like to do is have a label in the form header, that updates OnEnter in each control, showing the user the full description of the currently selected control. (It does display in the statusbar on the bottom, but it gets cut off usually.)
I -dont- want to plug in the code in each control's Enter/Leave/GotFocus, etc events. I want to auto-populate these on Form Load, or, maybe catch some other type of event when I switch focus between controls and then pass this to a generic function.
If this can be done on form load, I imagine I'd start with something like the following:
Expand|Select|Wrap|Line Numbers
- Private Sub SetControlEvents()
- Dim i As Integer
- For i = 0 To Controls.count - 1
- If Controls(i).ControlType = acTextBox Or Controls(i).ControlType = acComboBox Then
- 'set event for control
- End If
- Next
- End Sub