Unanswered: Event trigger for a "group" of controls on Access form
Got an Access Form Control question for ya:
I would like to perform some action when the focus is lost from a "group" of controls. That is, I have a set of similar controls after which the user leaves and goes on to another control on the form, some code needs to run.
Specifically, I have a set of Latitude/Longitude fields that need to be updated (decimal converted to DMS or vice versa) when the user leaves this suite of controls. Any ideas?
Torgue: thanks for the tip. The trick is that I need to detect that the focus is not on any of the other controls in that "group" before the update is run. Should I use .ActiveControl to check each control?
. . . since the Exit event is the first event fired on the "previous" control before the focus moves to the "new" control, you could set the value of a hidden control to True, on the Exit event of each control in your group of fields. All other fields could, on their Exit event, set that hidden field to False. Then, on those other fields, on the Got Focus event, you can test that hidden field and it would tell you whether the previous field was a "group" field, or not.
There's got to be another way so if anyone else has the time to think about this one, please post a better solution.