Mouse Wheel and forms

  • Thread starter Thread starter Gary Miller
  • Start date Start date
thanks for the link.
Isn't there any way to do it through coding and not using externall dll
files?
Thanks for your help



shadow
 
I've had mixed success getting the mousewheelonoff solution from
www.lebans.com to work for me. I have an IBM mouse with an eraser style
pointing device in it instead of a wheel and I can't seem to disable it. I
haven't tested it with an actual wheel mouse so I don't know if its the
mouse or the software. Instead, I adopted a different approach that someone
in this group suggested and it's working well.

First I have my form's Data Entry property set to yes. Then in the form's
AfterInsert event I put the following code:

lngTransID = txtTransID 'txtTransID is a hidden text box with an autonumber
primary key field in it

Me.DataEntry = False
Me.AllowAdditions = False
Me.Filter = "TransID = " & lngTransID
Me.FilterOn = True

TransID is the primary key so it's unique. It's important to keep these
lines in the correct order. If you try to set AllowAdditions to false while
your form's Data Entry property is still true you will get an error. What
happens is as you start to edit your record the AfterInsert event fires and
the form is no longer in data entry and no new records can be entered. The
filter property restricts the form's recordset to only one record which is
the current record. If you want to be able to add new records while the form
is still open you will need to put code in the click event of a button or
whatever device you decide to use to enable a user to add a new record. I
use the following code:

Me.FilterOn = False
Me.AllowAdditions = True
Me.DataEntry = True

This will automatically create a new record and force the form to go to that
new record.

It's important to keep these lines in the correct order. If you try to set
AllowAdditions to false while your form's Data Entry property is still true
you will get an error.

I hope this helps.
 
Thanks for the detailed explanations.
I'll give it a try and will report the result here


shadow
 
In a form that is designed to add new records to a table, when I turn the
wheel of the mouse, the form moves to the next or previous records. Is there
any way to cancel the wheel's action?



thanks for any kind of help
Shadow
 
Back
Top