First off sorry about the really bad layout…..I don’t know how to do all the fancy stuff but really wanted to share this because it seams like a lot of people wanted help with this.
So here is what I have going on.
I have a form to add a record, and I have a number of fields, then an “Add Record” button and a “Cancel Record” Button. What I wanted to do was:
A: Stop the form from going to another “New Record Form” when moving the mouse wheel
B: Stop the form from going to another “New Record Form” when pressing the “Tab” key
Here is what you got to do to solve the mouse problem:
1.) Create a field in the form that has the Name “MouseWheel Move”, and set the “Visible” property to “No”
2.) Enter the Fallowing:
Here is what you got to do to solve the Tab problem:
The last item on my form is my “Cancel” button; so when the focus is on my “Cancel” button (ie. the last item on the form) and I press tab I want the focus to go to the first field on my form.
One more thing, I am using Microsoft Access 2002 (10.6771.6735) SP3 and it works fine
So here is what I have going on.
I have a form to add a record, and I have a number of fields, then an “Add Record” button and a “Cancel Record” Button. What I wanted to do was:
A: Stop the form from going to another “New Record Form” when moving the mouse wheel
B: Stop the form from going to another “New Record Form” when pressing the “Tab” key
Here is what you got to do to solve the mouse problem:
1.) Create a field in the form that has the Name “MouseWheel Move”, and set the “Visible” property to “No”
2.) Enter the Fallowing:
Private Sub Form_Load()
3.) Enter The Fallowing:Me![MouseWheel Move] = "No"
End SubPrivate Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
4.) Enter The Fallowing:Me![MouseWheel Move] = "Yes"
End SubPrivate Sub Form_BeforeUpdate(Cancel As Integer)
If Me![MouseWheel Move] = "Yes" Then
End SubDoCmd.CancelEvent
Me![MouseWheel Move] = "No"
End IfMe![MouseWheel Move] = "No"
Here is what you got to do to solve the Tab problem:
The last item on my form is my “Cancel” button; so when the focus is on my “Cancel” button (ie. the last item on the form) and I press tab I want the focus to go to the first field on my form.
Private Sub Cancel_Button_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 9 Then
End SubMe![Field Name for the First Item on the Form].SetFocus
End IfOne more thing, I am using Microsoft Access 2002 (10.6771.6735) SP3 and it works fine