473,385 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

disable the mousewheel

mseo
181 100+
hi
I need to know how to disable the mousewheel, I have forms where the users must open on new records for entry
appreciate any suggestions
Jun 4 '10 #1
4 4802
missinglinq
3,532 Expert 2GB
I'm sorry, but I don't get the correlation between needing to disable the wheel and opening the form to a new record!

As to the disabling of the mousewheel, if you're running Access 2007, you already have a function that addresses this issue! Just check with Help.

For all other versions, you'll need some outside help. A gentleman by the name of Stephen Lebans has a sample database that does this and it can be downloaded at:

http://www.lebans.com/mousewheelonoff.htm

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:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  'Turn off Mouse Scroll
  3.  blRet = MouseWheelOFF
  4. End Sub
If you have one form that always loads first in your db, place the code there. If the first form to load varies, place the same code in each form.

You should be set now.

Concerning the opening on a new record for data entry, if you wnatusers to only be able to enter new records, you can set the form's DataEntry Property to Yes. This will allow entry of new records but will not allow access to existing records.

To allow both, use this code in the Form_Load event
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   DoCmd.GoToRecord , , acNewRec
  3. End Sub
Linq ;0)>
Jun 4 '10 #2
mseo
181 100+
thanks,missingling
I tried your approach it seems that I can not implement it correctly with access 2003
I tried this and I need to know your point of view about it
1- I declared public variable as boolean
Expand|Select|Wrap|Line Numbers
  1. Public mouseno As Boolean
2- on before update
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2. If mouseno = True Then
  3. MsgBox " mousewheel disabled .", vbOKOnly + vbInformation
  4. Cancel = True
  5. mouseno = False
  6. End If
  7. end sub 
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
  2. mouseon= True
  3. End Sub
thank you very much
I really appreciate your help
Jun 4 '10 #3
Hi mseo,
Best Example To Hook Mouse Wheel Without Dll File.

Try It.

Ahmed Tharwat(Medo)
Attached Files
File Type: zip MouseHookSampleDatabase.zip (64.3 KB, 344 views)
Jun 14 '10 #4
Chel
1
This code is working properly.Thank u so much.
You make my days happy.
Mar 15 '17 #5

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

Similar topics

6
by: deko | last post by:
Is it possible to disable the mouse wheel WITHOUT using a DLL? I've looked at Microsoft Knowledge Base Article 278379 (http://support.microsoft.com/default.aspx?scid=kb;en-us;278379), which...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Mark Johnson | last post by:
Seems the mousewheel isn't controlled in earlier versions like A97 or 2000. So you can accidentally use the mousewheel to scroll to the next record in an unbound form. And that can cause Access to...
2
by: GrandpaB | last post by:
Hi, How can I prevent the mousewheel from scrolling through the combobox items when it has the focus? Thanks, -- GrandpaB
1
by: Nicholas Shewmaker | last post by:
(I apologize if this posts twice. My AVG is being fussy.) From what I've read, MouseWheel is a very tricky event. I have replaced my Python tcl84.dll and tk84.dll files with those in the...
7
by: James | last post by:
Hi, I have a Windows Forms application which uses multiple child forms (MDI interface). The height of one of the child forms is larger than the height of the MDI client area, so when this...
3
by: Dave K | last post by:
I seem to be missing something... I want to use a mousewheel event in my VB.NET app... and there's a lot of example code on the net showing how to use the mousewheel event... and the .NET docs...
0
by: WaterWalk | last post by:
Hello. When I tried to make Tkinter canvas widget respond to MouseWheel event on Windows XP, I failed. The canvas just doesn't receive MouseWheel event. I used bind_all to find out which widget...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In a database search application (vb2005), the user wants to be able to scroll through records using the mousewheel. The data display form contains textboxes for the main data and a datagridview...
2
by: jl2886 | last post by:
I have done some reading about disabling the mousewheel. There is step by step instructions in a microsoft website. http://support.microsoft.com/kb/278379 Start Microsoft Visual Basic 6.0. 2....
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.