Geoff Codd
Registered User.
- Local time
- Today, 01:46
- Joined
- Mar 6, 2002
- Messages
- 190
I have the following code which is inserted into each form to disable the mouse wheel, the problem I am having is that it works fine for the main form but as soon as it is entered into a subform i get the following problems
1) I can't select any fields using the mouse
2) I get an error on closing the form relating to this clsMouseWheel.SubClassUnHookForm
Any help would be greatly appreciated
Thanks
Geoff
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
1) I can't select any fields using the mouse
2) I get an error on closing the form relating to this clsMouseWheel.SubClassUnHookForm
Any help would be greatly appreciated
Thanks
Geoff
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