boukasa
11-11-2008, 06:14 PM
I have a form with multiple fields. When the user clicks in a field, I populate a "suggestions" list box that gives them common values for the field. The suggestions are looked up in a database table. They can select a suggestion and click a button to copy the suggestion to the last active text box control.
Each time the user moves from field to field, I need to tell the Suggestions list box to requery, to get suggestions for the current field. Is there a way to do this without writing a separate event procedure for every text box's OnGotFocus event? Is there some form event or other thing that happens in one place every time a new control on the form gets the focus?
(I cannot programmatically set the OnGotFocus events, because some text boxes have events written for their OnGotFocus event. The only solution I can think of is too complicated - to iterate every text box on the form, check if it has an OnGotFocus event, if so to store the event in an array, then later to call the stored event - basically simulating something like C++ function overriding - too much infrastructure!)
Thanks for any assistance.
Each time the user moves from field to field, I need to tell the Suggestions list box to requery, to get suggestions for the current field. Is there a way to do this without writing a separate event procedure for every text box's OnGotFocus event? Is there some form event or other thing that happens in one place every time a new control on the form gets the focus?
(I cannot programmatically set the OnGotFocus events, because some text boxes have events written for their OnGotFocus event. The only solution I can think of is too complicated - to iterate every text box on the form, check if it has an OnGotFocus event, if so to store the event in an array, then later to call the stored event - basically simulating something like C++ function overriding - too much infrastructure!)
Thanks for any assistance.