Scrolling text box (1 Viewer)

zelarra821

Registered User.
Local time
Today, 15:50
Joined
Jan 14, 2019
Messages
813
Hello. I was going to ask in this forum if there was any way to scroll in a memo field, and searching the Internet, I found an example database that explains it very simply. I share it with you in case anyone is interested. It consists of importing the module, and pasting two codes in the form in question: one for the event When moving the mouse, and the declaration of the variable at the beginning of the form.
 

Attachments

  • Scrolling Text Box_V1.004.accdb
    468 KB · Views: 178

CJ_London

Super Moderator
Staff member
Local time
Today, 14:50
Joined
Feb 19, 2013
Messages
16,629
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.
 

Users who are viewing this thread

Top Bottom