disabling mouse wheel - compile error

M

Monish

Hi -

I have been grappling with this for a little while now and am hoping
somebody can set me straight...I am sure the resolution will be a quick fix,
but cant seem to get there myself.

I am trying to disable the mouse wheel in Access 2002 and have loaded the
*.dll file from Lebans zip file and have imported the module into my db as
well. I have also created a form with command buttons (on Click) that should
be turning my mouse wheel on and off...but when I run it, I get the following
error:

Compile Error: Ambiguous Name detected: MouseWheelOFF

The following is my code behind the new form:

Private Sub Command0_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please not the Optional GlobalHook BOOLEAN parameter
' Several developers asked for the MouseHook to be able to work with
' multiple instances of Access. In order to accomodate this request I
' have modified the function to allow the caller to
' specify a thread specific(this current instance of Access only) or
' a global(all applications) MouseWheel Hook.
' Only use the GlobalHook if you will be running multiple instances of Access!
blRet = MouseWheelOFF(True, False)
Me.txtStatus.Value = "The MouseWheel is turned OFF except for ListBox
controls, TextBox controls with ScrollBars and the Record Navigation control"

End Sub

Private Sub Command1_Click()
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON
Me.txtStatus.Value = "The MouseWheel is turned ON"

End Sub

Sorry to be so wordy - I want to make sure my issue is understood properly.

Thank you to anyone who may be able to help me.

M
 
K

Ken Snell [MVP]

What did you name the module where you put the MouseWheelOFF code? The
module must have a unique name; it cannot be the same as any procedure that
is in that module or any other module.
 
M

Monish

Ken -

I simply imported the modMouseHook module as directed...so the module is
named modMouseHook

Was that correct?

Thanks,
M
 
M

Monish

Ken (et al.)

I have finally figured out the problem:

My form where i set up the command buttons for turning mouse wheel on and
off included a line of code that was providing a text message and this was
the problem.
So, I removed the following two lines
Me.txtStatus.Value = "The MouseWheel is turned OFF except for ListBox
controls, TextBox controls with ScrollBars and the Record Navigation control"
&
Me.txtStatus.Value = "The MouseWheel is turned ON"

I guess this may have been obvious to many...but if not I hope this helps
someone else.

Thanks again,
Monish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top