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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed to disable the mouse scroll wheel

Status
Not open for further replies.

mondoray

Technical User
Jul 28, 2003
134
AU
Help,

I need to disable the mouse scroll wheel to prevent a user from scrolling through records. I have been able to disable the PgUp and PgDn keys but have had no luck with the mouse wheel.

Any suggestions would be welcome.

Mondoray
 
Eric,

As a previous Australian Prime Minister once said: "Life is not meant to be easy". He must have been talking about programming!

Many thanks.

Mondoray
 
I have been using the above method and it works like a dream.

Paul
 
Hey guys

I have been trying to do the same this with my database as well and I have come up with something that works and is less complicated than the one Microsoft Suggests although it is a little crude it does the trick. Let me know what you think of it you can add any improvements you want I am open to any suggestions.

This is what I did

Assuming you already have a form
Make sure your Navigation buttons are turned off you won't need them.

Instead replace the navigation buttons with your own command buttons.

Next Button (cmdNext)
Previous Button (cmdPrevious)
First Button (cmdFirst)
Last Button (cmdLast)
New Button (cmdNew)

after you have created these buttons you will create three additional textboxes

first textbox will be called
txtCurrent_Record
Second textbox will be called
tdtRecord
Third textbox will be call
txtRecord_Value

Now comes the code behind the form

on the onload event of the form you will enter
Me.txtRecord_Count = " Record " & Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = "1"

On the oncurrent event of the form you will enter
Me.txtRecord_Count = " Record " & Me.CurrentRecord & " of " & Me.RecordsetClone.RecordCount
If Me.txtRecord_Value = "0" Then
Me.txtRecord_Value = "0"
Else
Me.txtRecord_Value = "1"
End If
If Me.txtRecord_Value = &quot;1&quot; And Me.CurrentRecord < Me.txtRecord Then
DoCmd.GoToRecord , , acNext
ElseIf Me.txtRecord_Value = &quot;1&quot; And Me.CurrentRecord > Me.txtRecord Then
DoCmd.GoToRecord , , acPrevious
End If


On the onclick event of the cmdNew Button you will enter
Me.txtRecord_Value = &quot;0&quot;
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = &quot;1&quot;

on the onclick event of the cmdFirst Button you will enter
Me.txtRecord_Value = &quot;0&quot;
Me.AllowAdditions = True
DoCmd.GoToRecord , , acFirst
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = &quot;1&quot;

on the onclick event of the cmdLast Button you will enter
Me.txtRecord_Value = &quot;0&quot;
Me.AllowAdditions = True
DoCmd.GoToRecord , , acLast
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = &quot;1&quot;

on the onclick event of the cmdNext Button you will enter
If Me.NewRecord Then
Me.Recordset.MoveLast
Else
Me.txtRecord_Value = &quot;0&quot;
DoCmd.GoToRecord , , acNext
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = &quot;1&quot;
End If

on the onclick event of the cmdPrevious Button you will enter

On Error GoTo ErrPrevious:
Me.txtRecord_Value = &quot;0&quot;
DoCmd.GoToRecord , , acPrevious
Me.txtRecord = Me.CurrentRecord
Me.txtRecord_Value = &quot;1&quot;
Exit Sub:
ErrPrevious:
MsgBox (&quot;you are at the first record&quot;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top