Bob the OP's issue has to do with how far Access will scroll a Form
versus the legal positions of the Scrollbar.
By the way, if you are really using the code from the KB article then
you must not be using an SubForms. A more flexible solution is here:
http://www.lebans.com/mousewheelonoff.htm
MouseWheelHook97.zip is an MDB demonstrating how to use a MouseHook to
turn off the MouseWheel. No more MouseWheel.DLL Hell! No DLL
registration required. The MouseHook DLL is a standard Windows DLL. Do
not try to Register it or set a Reference to it from within Access.
Just copy the included MouseHook.DLL into your Windows/System folder or
into the same folder as your application MDB. One instance handles all
Forms and SubForms so only call the functions once from a SINGLE Form.
Here is an A2K sample MDB including the DLL. MouseWheelHookA2K.zip .
Please note there is no difference between the MouseHook.DLL included in
either the A97 or A2K ZIP file.
Here is sample code that can be placed behind CommandButton controls.
You could also place this code in the Load event of a single Form.
Remember you need to call these functions only ONE TIME. The MouseHook
will look after the MouseWheel messages for all forms that you have open
now or at any time during your current session. Remember to turn the
MouseWheel back on before you exit the current session!
Private Sub Command14_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
blRet = MouseWheelOFF
End Sub
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Bob Bergman" <technobob@bellsouth.net> wrote in message
news:a661f717.0405011845.15f93252@posting.google.c om...[color=blue]
> Go to
www.microsoft.com and search for the article... 278379 -
> ACC2000: How to Detect and Prevent the Mouse Wheel from Scrolling
> Through Records in a Form.
>
> I use the code in the sample on most of my applications, works well.
>
> Bob
>
>
> "Stephen Lebans"[/color]
<ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote in
message news:<5oBkc.32842$Np3.1194251@ursa-nb00s0.nbnet.nb.ca>...[color=blue][color=green]
> > Unfortunately Access will scroll the form to positions that are
> > technically not valid for the Scrollbar itself. It's a real pain in[/color][/color]
the[color=blue][color=green]
> > ass and has been for years! The only solution would be to subclass[/color][/color]
each[color=blue][color=green]
> > and every form which in my opinion is not practical.
> > :-(
> >
> > --
> >
> > HTH
> > Stephen Lebans
> >
http://www.lebans.com
> > Access Code, Tips and Tricks
> > Please respond only to the newsgroups so everyone can benefit.
> >
> >
> > "Devonish" <no.spam@nowhere.com> wrote in message
> > news:409104fa$0$197$75868355@news.frii.net...[color=darkred]
> > > I have a form designed as a Continuous form which displays one[/color][/color][/color]
record[color=blue][color=green][color=darkred]
> > > per
> > > line. Taking account of the header and footer and the size of the
> > > screen, I
> > > can display 30 records at a time. I can see other records by[/color]
> > scrolling[color=darkred]
> > > up or
> > > down with either the scroll bar on the right of the screen, or the[/color][/color][/color]
up[color=blue][color=green][color=darkred]
> > > and down
> > > arrows which are above and below this scroll bar; or I can use the
> > > scroll wheel
> > > on the mouse.
> > >
> > > If however, by filtering, fewer than 30 records need to be[/color][/color][/color]
displayed[color=blue][color=green]
> > the[color=darkred]
> > > mouse's scroll wheel behaves strangely. Now I know that there is[/color][/color][/color]
no[color=blue][color=green][color=darkred]
> > > need to
> > > scroll when all records are visible but I have a client who madly[/color][/color][/color]
uses[color=blue][color=green][color=darkred]
> > > the scroll
> > > wheel at all times. Furthermore, it is not always immediately[/color][/color][/color]
obvious[color=blue][color=green][color=darkred]
> > > that all
> > > records are visible (e.g. when there are, say 29, on display).
> > >
> > > The scroll bar (to the right) fills its whole space, indicating[/color][/color][/color]
that[color=blue][color=green]
> > all[color=darkred]
> > > records are
> > > visible, and therefore cannot be moved. However it is possible to[/color][/color][/color]
use[color=blue][color=green][color=darkred]
> > > the
> > > arrows to scroll down (losing some records form the top) and then[/color]
> > scroll[color=darkred]
> > > upto
> > > redisplay them all.
> > >
> > > It is also possible to use the scroll wheel to scroll down (again[/color]
> > losing[color=darkred]
> > > uppermost records) but when one tries to scroll back up again with[/color][/color][/color]
the[color=blue][color=green][color=darkred]
> > > wheel
> > > the top record is never made visible. It is always just out of[/color][/color][/color]
reach.[color=blue][color=green][color=darkred]
> > > (By using
> > > the arrow, it can be made available again)
> > >
> > > Why does the scroll wheel have this strange behaviour? and is[/color][/color][/color]
there[color=blue][color=green]
> > any[color=darkred]
> > > way
> > > round it? (that is without using the arrows above and below the[/color][/color][/color]
scroll[color=blue][color=green][color=darkred]
> > > bar)
> > >
> > >
> > > *** Sent via Developersdex
http://www.developersdex.com ***
> > > Don't just participate in USENET...get rewarded for it![/color][/color][/color]