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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse Wheel 2

Status
Not open for further replies.

RandyMyers

IS-IT--Management
Apr 28, 2004
85
US
Is there any way that I can set the mouse wheel to scroll within a field (for example a field with vertical scroll bars) instead of the default scroll to new record?
 
Maybe this needs to be clarified.

I am trying to have the mouse wheel scroll with in a large text box to review the data within this particular field.

By default the mouse wheel moves to another record instead of scrolling within the text box.

Does this make sense? Any ideas of how to do this?
 
Randy,

I know the problem, it would be good to get an answer. It would be usefully on Memo fields that can be VERY large. OnMouseWheel is only on the form Not on TextBox. Have you looked at Google groups?

Never give up never give in.

There are no short cuts to anything worth doing :)
 
It should be possible, however you would probably need to use an API call. It may be worth reposting on Forum 713 (Win API), someone there may be able to help.
 
I found the following Hope it Helps.

Stop mouse wheel from scrolling through records in a Microsoft Access form - Microsoft Access Database Solutions:

Have you ever wanted to prevent your Microsoft Access database users from scrolling through form records with the mouse wheel. It can becoming quite an annoyance when they're editing a record and (for some reason) they use the mouse wheel and zoom to another record.

The following example uses the MouseHook DLL file that is a standard Windows DLL. Do not try to Register it or set a Reference to it from within Access.

The example is adapted using code from Stephen Lebans MouseWheelOnOff sample. Take a look around Stephen's site as there are many good Microsoft Access sample files available.

With our example, we have disabled the Mouse Wheel from scrolling through the records in the Microsoft Access form, when the Form loads.

This is simply done by using the following code sample, attached to the OnLoad event of the Form:

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
To implement this feature, all you need to do is to ensure that the MouseHook.dll file that is stored in the downloadable zip file is stored in the same location as the database file. You will then need to import into your own MDB the standard code module "modMouseHook" found in the sample MDB included in the download zip file.

Add the code to the Onload event of the form that you are working on to prevent the user from using the mouse scroll wheel


Never give up never give in.

There are no short cuts to anything worth doing :)
 
This sounds like it might do the trick...

Do you have a link to the MouseHook function and the MouseHook.dll?

Could you possibly e-mail these files to me?

Thank you...
 
There is an update if you want it to work with sub forms on Steve's site. Have not tried it.

Never give up never give in.

There are no short cuts to anything worth doing :)
 
Works great....

Looks like he has some fantastic stuff out there!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top