Disabling mouse scrolling issue

M

Mr.Kane

I am attempting to use Microsoft's KB instrucitons to disable mouse
scrolling in a form.

after adding the following code to the module of the form:

Option Compare Database
Option Explicit

Private WithEvents clsMouseWheel As MouseWheel.CMouseWheel

Private Sub Form_Load()
Set clsMouseWheel = New MouseWheel.CMouseWheel
Set clsMouseWheel.Form = Me
clsMouseWheel.SubClassHookForm
End Sub

Private Sub Form_Close()
clsMouseWheel.SubClassUnHookForm
Set clsMouseWheel.Form = Nothing
Set clsMouseWheel = Nothing
End Sub

Private Sub clsMouseWheel_MouseWheel(Cancel As Integer)
MsgBox "You cannot use the mouse wheel to scroll records."
Cancel = True
End Sub



I received the following error: Compile Error: Invalid Attribute or Sub
Function
with the following code highlighted: WithEvents clsMouseWheel As
MouseWheel.CMouseWheel

Any help would be appreciated.
I know that many have solved this issue but I've been working on this
for several hours and just need the obvious solution

Thank you
Marc Kane
 
G

Guest

I take it you have done both the ActiveX and module parts listed in the same
KB?

TonyT..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top