Disable Mouse Wheel Access 2003/2002

  • Thread starter Thread starter Rick Jones
  • Start date Start date
R

Rick Jones

I just installed the Access 2K MouseHook.dll in an Access 2003 application.
I call the MouseWheelOff funciton from the applications main menu form in
the OnLoad Event and the mouse wheel still works. MouseWheelOff is
returning true.

Additionally I tried the frmSampleData form under Access 2002 in the code
examples distributed with the A2KMouseWheelHook.zip and I am able to scroll
records in the Sample Subform by clicking in the text box even though the
form indicates: "The MouseWheel is turned OFF except for ListBox controls,
TextBox controls with ScrollBars and the Record Navigation control".

I'm using an IntelliPoint mouse, what am I missing? Any help is
appreciated.

Thanks,
Rick
 
Rick I have not tested the MouseHook with Access 2003 as I do not have
it installed here. What happens when you open the sample Form in A2003?
Does it work as advertised?

As for A2002, I'm not sure where the problem is. The behaviour is by
design. For subforms in Continuous or Datasheet view, the Mousewheel
will advance through the recordset via any visible ScrollBars of the SF
control. What do you see as being wrong with this functionality? Does
the sample form work correctly by stopping the reocrdset from scrolling
when the cursor is in or hovering over all of the other form controls?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephen,

Sorry, I was under the impression that the mousewheel would be disabled in
subforms also. The code works fine running under Access 2003. Can mouse
wheel scrolling be totally disabled? I've inherited an app where the mouse
wheel is playing havoc with many subforms. The client is perfectly willing
to discard all mouse wheel scrolling (combo boxes, list boxes, etc) if it
will stop the behavior in subforms.

Thanks,
Rick
 
Just so I can understand the situation better Rick, could you explain
why allowing the MouseWheel to function normally within a SubForm
control is playing havoc with your user's forms? If you can help me to
understand this issue then I would be willing to add an Optional
parameter to the MouseWheelOff function that would disable the
MouseWheel within a SubForm control.
:-)

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Is your database accessed by multiple users over a
network?

If it is, I recommend using the following method that
creates local tables from the mdb onto the users PC, only
pulls the specified record, then fills the form from that
RecordSource.

- Make a seperate table with the one field that is the
field the combo is searching from, and call it tbl(field
name), here I'll call it tblSearch, and I'll assume the
field is a primary key in the main table(which I'll call
tableKey, and I'll call the field "Key".

- Make a combo or list box that looks up values in
tblSearch, name the control cmbSearch

- The code will basically go:

Private Sub cmbSearch_AfterUpdate()
Dim RS As Recordset
DoCmd.Run SQL "SELECT * FROM tableKey WHERE Key = '"
& cmbSearch & "' ", "tableKey_Local"

Set RS = CurrentDb.OpenRecordset("tableKey_Local",
dbOpenDynaset)

With RS
ControlA = ![field in table you want in this control]
ControlB = ![same as above, and so for all controls]
End With
RS.Close
Set RS = Nothing

What all that basically does, is a make table query where
the record matches what is selected in cmbSearch. Makes
it a local table(on the users Front End), and populates
the form fields from that record. When user selects
another term from cmbSearch, the code writes over the
local table(s) with the new data.

Seems complicated, maybe, but this COMPLETELY ELIMINATES
the mouse wheel from scrolling thru records as there is
ONLY ONE RECORD on the local table at any one time.

If you run this over a network w/ multiple users, this
sort of setup is ESSENTIAL to prevent crashes and improve
speed.

There is another module I wrote to make the above easier,
but don't have access to it at this moment.

Hope I helped!
Chris H.
 
Back
Top