preventing record scrolling with mouse scroll

B

BP

hi,

How do i prevent the records being switched around when i use the mouse to
scroll up/down

My form is pretty lengthy and i have to scroll up and down to fully view the
page. But its irritating that the records scroll instead of the page. Is
there a way to make it so that the record is unable to be switched around
except by the use of the arrow and *arrow button at the bottom left of the
form?

BP
 
C

cscotty via AccessMonster.com

BP said:
hi,

How do i prevent the records being switched around when i use the mouse to
scroll up/down

My form is pretty lengthy and i have to scroll up and down to fully view the
page. But its irritating that the records scroll instead of the page. Is
there a way to make it so that the record is unable to be switched around
except by the use of the arrow and *arrow button at the bottom left of the
form?

BP

Here ya go....this is what I used and it works great. Just let us know if
you need help installing it.

http://lebans.com/mousewheelonoff.htm


Regards,
Scott
 
B

BP

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.
 
C

cscotty via AccessMonster.com

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
 
B

BP

that works great. Thanks alot.

But would it turn back on after I exit access?

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
 
C

cscotty via AccessMonster.com

BP said:
that works great. Thanks alot.

But would it turn back on after I exit access?
[quoted text clipped - 44 lines]
Regards,
Scott

Great to know that it works! Yes, the module is only active inside of Access.


Regards,
Scott
 
V

Valerie Wong

Hi Scott,

Many thanks for the tips. However I couldn't get it to work. 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
 

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