This is example code to disable/enable the mouse scroll wheel from:
http://www.lebans.com/mousewheelonoff.htm.
***********
Note: Another technique which works very well (without needing ANY dll or mousewheel code) is to put this code in the OnCurrent event of the form:
docmd.gotorecord,,acfirst
This works when you're ONLY dealing with 1 record on the form and want to prevent users from scrolling to a new blank record accidently.
***********
The second attachment (NoScrollMouseWheel.Zip) is a form I designed but copied the appropriate code from the MouseWheelOnOff.zip, leaving out code (and the module) I found not needed to make the technique work. I did not design any of the mousewheel code and take no credit for it.
Note: You can also try this neat little trick without using ANY mousewheel code:
If you're only dealing with 1 record on a form (ie. you use criteria to return that 1 record) and want to prevent scrolling to a new record (but need to also allow additions to the form), in the form's
OnCurrent Event add this code:
docmd.gotorecord,,acFirst
This has worked very well for me and if the user tries to use the scroll, it will automatically go back to the first record! (so the user can't accidently scroll to a blank record.)
Also see this post:
DBForums Code Bank