dulla
Technical User
- Feb 3, 2003
- 54
i have looked at the link and it works great for the sample db. but i can't get it to work in my db. i keep getting the message:
"The expression On Load you entered as the event property setting produced the following error: User-defined type not
defined
*the expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*there may have been an error evaluating the function, event, or macro. "
When i close the form, i get the same thing but for the 'On Close' event. here is what i put in the Clients Information form that i have:
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
The rest of the reference code is within the link that was provided:
Why am i getting this error in my code, when it worked in the northwind sample? and i have also accounted for duplicate events when adding the new code. (form load). Any Ideas? Thank you.
Ameen
"The expression On Load you entered as the event property setting produced the following error: User-defined type not
defined
*the expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*there may have been an error evaluating the function, event, or macro. "
When i close the form, i get the same thing but for the 'On Close' event. here is what i put in the Clients Information form that i have:
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
The rest of the reference code is within the link that was provided:
Why am i getting this error in my code, when it worked in the northwind sample? and i have also accounted for duplicate events when adding the new code. (form load). Any Ideas? Thank you.
Ameen