Disable Mouse Wheel Access 2003/2002
From: Chris H. (anonymous_at_discussions.microsoft.com)
Date: 04/28/04
- Next message: george: "synchronizing list with form"
- Previous message: Sardinha: "Test a field for error"
- In reply to: Rick Jones: "Disable Mouse Wheel Access 2003/2002"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 05:49:45 -0700
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.
- Next message: george: "synchronizing list with form"
- Previous message: Sardinha: "Test a field for error"
- In reply to: Rick Jones: "Disable Mouse Wheel Access 2003/2002"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|