Okay, I finally was able to get things going with the results that I
wanted. I ended up using the solution that was published in the MSKB
article KB308636 (
http://support.microsoft.com/default...&Product=acc97)
In order to deploy this application to multiple computers without
having to register the dll on each machine, this is the solution I
created:
1. Create a new module.
2. Insert the following code:
Option Compare Database
Option Explicit
Declare Function DllRegisterServer Lib "<fullpath>:\MouseWheel.dll" ()
As Long
Declare Function DllUnregisterServer Lib "<fullpath>:\MouseWheel.dll"
() As Long
3. Open the form and add the following:
Option Compare Database
Option Explicit
Private WithEvents clsMouseWheel As MouseWheel.cMouseWheel
Private varRegister As Variant
4. In the Form_Load event add the following:
varRegister = DllRegisterServer
Set clsMouseWheel = New MouseWheel.cMouseWheel
Set clsMouseWheel.Form = Me
clsMouseWheel.SubClassHookForm
5. In the Form_Close event add the following:
clsMouseWheel.SubClassUnHookForm
Set clsMouseWheel.Form = Nothing
Set clsMouseWheel = Nothing
varRegister = DllUnregisterServer
6. Create a new sub in the form:
Private Sub clsMouseWheel_MouseWheel(Cancel As Integer)
' Optionally add messages here to indicate Mouse Wheel is
inappropriate
' i.e. MsgBox "Mouse Wheel cannot be used here!"
Cancel = True
End Sub
This process has worked for me on Access 97.
md*******@hotmail.com (AccessWhiz) wrote in message news:<19**************************@posting.google. com>...
I have been trying desperately for the past few days to figure out why
the MouseWheel solution that I retrieved from the Lebans website won't
work. The access database included with the solution responds to the
the wheel regardless of the button. In my application I get an error
message when I try to set the class. I'm hoping that I can get some
help (cause I feel really stupid right now).
Before we go too much further, I am using a Logitech Wheel mouse, does
this make any difference?
I am using Access 97 on a Windows 2000 Professional OS. I downloaded
the files from the Lebans website. I made sure the MouseWheel.dll is
in the folder where I'm trying to figure out how to make this work in
my application.
I open the A97MouseWheelHookerver7.mdb file and open the form
(frmSampleData). Clicking the buttons to turn on or off the mouse
wheel still allows me to scroll through the everything regardless of
which button I click.
When I try to put the code in my own application I get an error on
this statement:
Set clsMouseWheel = New MouseWheel.cMouseWheel
The error message reads: Run Time error '429' ActiveX component can't
create object.
Yes, I've inserted all the code from the A97MouseWheelHookver97. I
tried registering the dll but get an error when trying to register
MouseHook.dll.
help!
Thanks in advance