Here is sample code that can be placed behind CommandButton controls. You could also place this code in the Load event of a single Form. Remember you need to call these functions only ONE TIME. The MouseHook will look after the MouseWheel messages for all forms that you have open now or at any time during your current session. Remember to turn the MouseWheel back on before you exit the current session!
Private Sub Command14_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub
Or if you will be running multiple instances of Access then you can pass an optional parameter to ask for a Global Hook. The default is FALSE. Please note the Version documentation below.
blRet = MouseWheelOFF(True)
Private Sub Command16_Click()
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON
End Sub
|