Stopping a form from scrolling (was assigning mouse wheel)

M

Max Moor

Hi All,
Okay, if I can't assign the mousewheel to a control, what are my
options for making a single form not scroll?

The obvious answer is to turn off 'AllowAdditions'. Unfortunately,
when I do this on one form, when I save changes and close the design view,
Access gives me the "There's been a problem, and I must close" message. On
another form, Setting 'AllowAdditions" to 'No' makes the from fail on it's
open subroutine, when I try to set the value of a combo box. (any thoughts
on either of these would be appreciated)

In the case where solutions to the above elude me, is there another
way to keep the single form from scrolling?

- Max
 
S

Stephen Lebans

See:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top