wheel mouse event

J

Julie

I have a data entry form that allows additions and edits and cycles the
current record. When a user uses their mouse wheel, the form goes to a new
page. I've used the following code to notify them:

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
MsgBox "DO NOT USE YOUR MOUSE WHEEL TO SELECT FROM THE DROP DOWN MENU...USE
THE SCROLL BAR TO THE RIGHT. To return to your page, push the mouse wheel up."

End Sub


Instead of asking users to push their wheel mouse up (which brings up the
msgbox again and causes confusion), is there a way to get Access to return to
the record they were on when the user closes the msgbox?

Phrased a different way:
When a user uses their wheel mouse, access goes to a new page and a msgbx
comes up telling the user not to do that. Can we get access to go back to
the original record (the last record) when the user closes the msgbx?


THANKS
 
J

Julie

Sorry guys, neither option worked. The website code information just errored
out.

The code below doesn't reset the page to the last existing record when I
clost the message box, just a blank new record.

Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)

MsgBox "DO NOT USE YOUR MOUSE WHEEL TO SELECT FROM THE DROP DOWN MENU...USE
THE SCROLL BAR TO THE RIGHT."
Me.Recordset.MoveLast

End Sub

I'm still hunting for a solution. I'd love to redo the whole form and go
with the other options you suggested, but I don't have time and there's a lot
of complicated code on form load that I don't understand.
 
J

Jeanette Cunningham

Yes, it's not straight forward to use the mouse hook code unless you are a
seasoned coder.
This is how I use the mouse hook code and it works fine.
I put the mousehook code (from the website) in a standard module.

I have code in either my startup form or autoexec macro to set up the mouse
wheel-->
Dim blRet as Boolean

' Turn the MouseWheel Off
blRet = MouseWheelOFF
--------------------------------


This is the only code I need to remove the annoying scroll from the whole
database.
This code runs every time I open the database.
If you do it is this fashion, there is no need to bother with code on the
mousewheel event for any forms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top