Disable Mouse Scrolling Wont Work!

bogglebeats

Registered User.
Local time
Today, 09:46
Joined
Dec 19, 2002
Messages
53
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:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q308636

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
 
I just tried that procedure.
It works.
You probably forgot to set a reference to MouseWheel.dll.

# On the View menu, click Code to display the module of the form in the Visual Basic Editor.
# On the Tools menu, click References.
# To select the reference, click to select the check box next to MouseWheel. If this reference is not listed, click Browse, click MouseWheel.dll in the folder where you saved it (in Step 12 of the preceding procedure), and then click Open.
# Click OK to close the References dialog box.
 
no. i have set all of the references and still same error. any ideas?? thanks.
 
There is a known problem with Access sometimes losing a reference even though it shows it as checked. Try unchecking all of the references that you can (some cannot be unchecked). Compile and save. Recheck all of the references again. Compile and save. This might fix your problem.
 
ok i got it to work somehow. the main form works fine, but i can't get the subforms to work. if i open the subforms individually they work fine (you can click in the fields and the mouse scroll is disabled). However, when i access the subform from the main form (by opening the main form) the mouse scrolling is disabled, but the fields seem to be locked (i can't place the cursor in them, or press any buttons). Is there any way to disable mouse scrolling for the main form AND the subform? thanks

ameen
 
Check out the NoMouse.zip file I posted. It works and it does not require any DLL or checking if the record is Dirty. I did not create the sample, I just added the ability to turn it on and off to demonstrate how it works.

HTH
 

Users who are viewing this thread

Back
Top Bottom