Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2018
  • Last Modified:

MSAccess - Scroll wheel in a Memo field on a form

A user asked about the possibility of adding the capability to use the scroll wheel to scroll within a Memo field on a datasheet view/form view.

- On the Datasheet, the scroll wheel just scrolls thru the records.  I suppose I could disable the scroll wheel on the mouseover event of the memo field.

- On the form, scroll wheel does nothing in a Memo box.

I couldn't find a quick answer, but thought someone might have run into a similar request.

Any sugestions?

Thanks!

0
markp99
Asked:
markp99
1 Solution
 
jjafferrCommented:
Access cannot turn off the mouse wheel control natively, you have to usea 3rd party tool like:
http://www.lebans.com/mousewheelonoff.htm

as far as scrolling through the memo field, I don't think it is possible,
but you can put the following code "On Double click" of the memo field:

    'zoom to see the rest of the data inside the textbox
    DoCmd.RunCommand acCmdZoomBox

this will open the memo field in a bigger window.

jaffer
0
 
oldmanbimCommented:
Jaffer's right.

However, here is quick fix to this if you're not to particular about the "elegance" of your solution.  

You'll need to set the On Mouse Wheel event of your form to "[Event Procedure]"
Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
    ' A multiplier for Count, which is how far to jump (jump = "scroll")
    ' A good estimate for this is 2x your text box width in inches
    Const DELTA As Integer = 8
    Dim NewPos As Long
 
    ' The tag "UseWheel" marks a control as scrollable
    If Screen.ActiveControl.Tag <> "UseWheel" Then Exit Sub
 
    ' Do the scroll
    With Screen.ActiveControl
        ' Make sure there is no selected text
        .SelLength = 0
 
        ' Get the new position
        NewPos = .SelStart + Count * DELTA
 
        ' Make sure it's not 0 and set SelStart
        If NewPos < 0 Then .SelStart = 0 Else .SelStart = NewPos
 
    End With
 
End Sub

Open in new window

0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now