Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Wheel Mouse 1

Status
Not open for further replies.

shelby55

Technical User
Jun 27, 2003
1,229
0
0
CA
Hi

I'm using Access 2003.

I have a form and the wheel mouse scrolls through records which I don't want it to do.

I searched the archives and found this:
However, I do not have Visual Basic to program this in and I'm anxious about creating entirely in Access due to the notes of caution. Does anyone know where else I can get this code?

Thanks.
 
Thank you, Thank you, Thank you.....just what I needed and was looking for! Works awesomely!!

 
Hi

I've run in to a problem with this that I hope someone can help with.

As indicated by the link I was sent to, the wheel off code is in the form_load event and the wheel on code is in the Form_Unload event.

I have buttons on my form (in the form footer) for the application which are add record, edit record, delete record and save record.

So when I enter the form, it's fine and I can't scroll through records with the wheel mouse.

Add a record is fine but interesting to note that if I use scroll mouse while adding a new record it triggers the record to be saved. Once saved, the mouse wheel allows to scroll through records which I don't want it to do.

Selecting edit record is also fine in that scrolling doesn't occur but once the record is saved, it does.

The code in my save record command button is:
Code:
private sub cmdSave_Click()
      if me.dirty then
      docmd.runcommand acCmdSaveRecord
       MsgBox "Record Saved"
      End If
      me.allowedits = false
      end sub

Any and all assistance greatly appreciated.




However, when I save a record, I am able to scroll through the records with the mouse wheel which I don't want to be able to do.

The save
 
Hi

Actually I found a different solution for the wheel mouse on/off that doesn't require a .dll to be included in it


Also, I fixed my problem by using this new technique which adds the code to the On Open event but I'm sure I could have added the other code to the On Open event instead of the On Load event and it probably would have worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top