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 DllRegisterServ er Lib "<fullpath>:\Mo useWheel.dll" ()
As Long
Declare Function DllUnregisterSe rver Lib "<fullpath>:\Mo useWheel.dll"
() As Long
3. Open the form and add the following:
Option Compare Database
Option Explicit
Private WithEvents clsMouseWheel As MouseWheel.cMou seWheel
Private varRegister As Variant
4. In the Form_Load event add the following:
varRegister = DllRegisterServ er
Set clsMouseWheel = New MouseWheel.cMou seWheel
Set clsMouseWheel.F orm = Me
clsMouseWheel.S ubClassHookForm
5. In the Form_Close event add the following:
clsMouseWheel.S ubClassUnHookFo rm
Set clsMouseWheel.F orm = Nothing
Set clsMouseWheel = Nothing
varRegister = DllUnregisterSe rver
6. Create a new sub in the form:
Private Sub clsMouseWheel_M ouseWheel(Cance l 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*******@hotma il.com (AccessWhiz) wrote in message news:<19******* *************** ****@posting.go ogle.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 A97MouseWheelHo okerver7.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.cMou seWheel
The error message reads: Run Time error '429' ActiveX component can't
create object.
Yes, I've inserted all the code from the A97MouseWheelHo okver97. I
tried registering the dll but get an error when trying to register
MouseHook.dll.
help!
Thanks in advance