How to Detect Movement from a Datasheet to a SubDataSheet

In an Access XP ADP, I have a main form (frmMain) with a subform (fsfrFeature). The subform is only displayed in datasheet view. The subform is a recursive subform, i.e. it contains another subform whose source object is also fsfrFeature. This lets me easily do a bill of materials type user interface (as a side note this apparently can't be done in a mdb). I also have some code attached to the Form_Current event of fsfrFeature. As I move from 1 record to another on the subform, the code in Form_Current fires as expected. However, if I expand the current current record in the current datasheet and click in any record of the newly visible subdatasheet, the Form_Current even for the subdatasheet does not fire. But if I then move to another record in the subdatasheet, the Form_Current event fires properly. If I then click in the parent record for the current subdatasheet record, the Form_Current event of the parent datasheet does not fire. So, how can I detect that the user has moved from one level of subdatasheets to another? Also, if I'm in a subdatasheet row and I collapse any level above it, I have the same problem. I need to know because the Form_Current event changes the recordsource for a popup form that is associated with the current row of the current subdatasheet.
rmkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rmkAuthor Commented:
Using the GotFocus event for each control on the subform was the solution. Each of these events now calls a procedure that does the following:

- identifies if the proper popup form is open; this is done via the tag property of the top most parent form that opened the popup form; the tag property contains the handles of any popup forms that I have opened from this top most parent form. This allows me to use multi instance popup forms and hide / unhide these using the activate / deactivate / close events of the top most parent form

- if the proper pop up form is open, build the recordsourse as an sql string; if the sql string is different than the recordsource of the pop up form, set the record source to the sql string; so even, if I tab thru all the controls on a row, the recordsource of the pop up form is only set once.
LunchyCommented:
Closed, 500 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.