Yes, that code has been around for a while - it is only an example so needs more work. I also understand that textbox scrolling has been resolved in later versions of access, certainly resolved in latest 64bit.
Examples of issues with the code provided - although they may be desired effects:
- If user clicks on the control, scrolls then clicks on another control, on return, the scrolled position is lost
- If user clicks on the control, then moves off the control, unless they click on another control the mousewheel will still scroll the original control
- If user clicks on a standard control, then moves the mouse to the lower subform and scrolls (without selecting a textbox) the standard control will scroll.
All solvable, but solution will depend on the actual usage required.
Example resolution would be to use the name of the control rather than identifying it as a textbox - but that won't work in a continuous form or as here two subforms with controls with the same name.
Another way is to identify the control below the mouse - use the control mousemove event to populate a control object and the form mousemove event to empty the control object.