Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the mouse

Status
Not open for further replies.

lemonjuice

Programmer
Jun 12, 2003
62
0
0
ZA
Does anyone know how i can disable the mouse scroll(wheel) on a form?
 
did you ever get an answer.

i am having the same problem with a form with tabs on it. when the users scroll, like to move through a combo list, the app. will scroll through the records based on the primary key of the main table. i would like to disable that and hopefully only have the scroll apply to whatever control is active.
 
Nope, sorry. I never found a sollution. I hope you will get one.
 
I found the following solution at
Private Sub Form_Load()
' 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(False)
End Sub

I have tried using this but to no avail. The fix requires downloading a MouseWheel.dll file.
 
Lemonjuice,

I don't know how to disable the mouse wheel, but have you tried a work around? Then last time I messed with eventInfo.id(), Footpad (Lance) was still on this forum to bail me out of trouble. But it seems like you could put something like this on the action method:

If eventInfo.id()=DataNextRecord or
eventInfo.id()=DataPriorRecord
then
; insert code to test if you want to prevent user
; from going on to the next record
else
doDefault ; allow user to move to next record
endIf

When I checked to see what events were generated by the mouse wheel, at least the cases I looked at it was always an eventInfo.id of 3072 (DataNextRecord) or 3073 (DataPriorRecord).

Lynn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top