Updating access records in vb6
This is quite an annoyance when you might not want this behaviour, and Microsoft never offered a simple solution to turn this feature off (until v2007).There are other solutions such as forcing the currently displayed record to always be in edit mode, but we won't discuss them here - they have their own drawbacks too.
Also, your forms will take a performance hit since every window message goes through the relatively inefficient VBA subsystem.
My solution is to use the subclassing method as described in the VBA article above, but rather than use a VBA subroutine as the callback procedure, I use a native machine code compiled procedure (read the technical stuff below if you want to understand how this is achieved).
UPDATE v1.5: 04/12/2009 -- now the Init and Scroll object methods are case insensitive (fixes potential "Object does not support..." errors) This solution is being provided for free and you can use this solution in your applications freely provided you leave the copyright notices in place in the source code.
In Access versions prior to v2007, when you use the mouse scroll wheel on a form, Access will always cycle through the current records in your forms dataset.
If you want further details on how the bas Mouse Hook VBA module works... VBA allows us, with the help of the Rtl Move Memory API call, to cast any numeric value into a VBA variable.