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.