Re - preventing record scrolling with mouse scroll

V

Valerie Wong

Hi, re- another question posted (see correspondence below), I could not get
the stop mouse scroll module to work in my database. When I save and
go back to my Form in Form View, I get an Microsoft Visual Basic Message:

Compile error:
Ambiguous name detected: MouseWheelOFF

Please could you advice?


cscotty via AccessMonster.com said:
BP said:
Hello,

May I have more detail instructions on how to use this with my access mdb? I
have unzipped your file and it is another mdb file.
[quoted text clipped - 16 lines]
Regards,
Scott

Sure! Its actually not my file though :) Here's what to do.

1. Open the database that is included and go to the form named frmSampleData
in design view.

2. Look at the form properties at the OnLoad Event, and click the [...] next
to the OnLoad event. This will bring up VB.

3. Once open, look to the left pane and you will see a module named
"modMouseHook". Right Click it and click Export File. Save the file as
modMouseHook.bas and take note of where you saved it.

4. Close the sample database and open your own.

5. Paste the following code in the "OnLoad" event of your form (in VB):

' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please note 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(False)

6. Still on the VB screen on the left pane, right click and select Import
File and import the file you saved in step 3.

7. Save everything, close everything out and reopen and test to see if it
works.

Regards,
Scott
 
D

Douglas J. Steele

That means you have two (or more) different routines named MouseWheelOFF
somewhere in your database. You'll have to do a search to find them all, and
eliminate all but one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Valerie Wong said:
Hi, re- another question posted (see correspondence below), I could not
get
the stop mouse scroll module to work in my database. When I save and
go back to my Form in Form View, I get an Microsoft Visual Basic Message:

Compile error:
Ambiguous name detected: MouseWheelOFF

Please could you advice?


cscotty via AccessMonster.com said:
BP said:
Hello,

May I have more detail instructions on how to use this with my access
mdb? I
have unzipped your file and it is another mdb file.

hi,

[quoted text clipped - 16 lines]
Regards,
Scott

Sure! Its actually not my file though :) Here's what to do.

1. Open the database that is included and go to the form named
frmSampleData
in design view.

2. Look at the form properties at the OnLoad Event, and click the [...]
next
to the OnLoad event. This will bring up VB.

3. Once open, look to the left pane and you will see a module named
"modMouseHook". Right Click it and click Export File. Save the file as
modMouseHook.bas and take note of where you saved it.

4. Close the sample database and open your own.

5. Paste the following code in the "OnLoad" event of your form (in VB):

' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please note 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(False)

6. Still on the VB screen on the left pane, right click and select
Import
File and import the file you saved in step 3.

7. Save everything, close everything out and reopen and test to see if
it
works.

Regards,
Scott
 

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