By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

how to lock mouse wheel

P: 14
I want to lock the mouse wheel cause scrolling takes to next record in my application.I tried to find online but no use.I found some article
but i don't want to use thirdparties.

Is there any other way to implement it?Is it difficult to implement one?

Jan 30 '09 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,532
Not unless you're running Access 2007, which finally addressed the problem. Lebans hack has pretty much been the gold standard for years now. It's really not hard at all.

First, download and unzip the db and take a look. Go into your db and goto File > External Data > Import and import the module modMouseHook from the sample database.

Next make sure you have the included file, MouseHook.dll, in the same folder your database resides in.

The following code needs to run before the mousewheel will be locked: If one particular form is always opened first, place this in that form's code module. If the first form opened varies, place it in each form's code module. Calling it more than once does no harm.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   'Turn off Mouse Scroll
  3.     blRet = MouseWheelOFF
  4. End Sub
You should be set now.

Linq ;0)>
Jan 30 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.