0
votes

I have a form which contains multiple datasheet subforms, sorted into different pages of a tab control.

Each subform datasheet is based on an entirely different query, although in my case all subforms will always contain the exact same number of records as each other.

Question: Is it possible to programmatically capture user scrolling input (via keyboard, mousewheel, navigation buttons, or any combination thereof) and pass that information across subforms, so that, regardless of what the user does, whenever they switch pages/tabs, the same record number will always appear in row position one on every page/tab?

E.g. I have three subforms, each located with its own page control, and each underlying recordset has exactly 1000 records. A user scrolls down so that record # 575 shows in the first row of that page's subform. The user never actually selects any record, merely scrolls using mouse or keybpoard.

Is it possible to guarantee, that if the user switches to a different page/tab, that record number 575 of the corresponding recordset will show in the first row of the new page's datasheet?

1
I've been trying to capture the state of the active tab using .currentselectiontop to measure the distance from the last (ie. 1000th) record form the top of the subform, and using that as a proxy for the scrolled position of the form. I'm running into some troubles successfully passing this info to the other subforms though (.currentselectiontop is read only). I'm not sure Im even on the most desirable path to accomplish what I'm trying to do, but so far this only thing that even seems promising. - John Q. Noob

1 Answers

1
votes

There is no event to catch the scrolling itself, but you can control that the same current row id is visible in all subforms.

Full code and explanation including a working demo can be found and downloaded here:

Synchronizing Multiple Subforms in Access