preventing records to be scrolled with the mouse wheel in EditView

G

Guest

Hi all,

I have a single form which is set to allowedits = false, it is thus a form
which I call ViewMode. But the same form, through an 'edit' button, can
become allowedits = true, so called EditMode, and be used to edit records.
I've just discovered that if I click in a field and use the mouse wheel, I
can browse the whole recordset; which is nice in ViewMode, but I have to
absoultely disable this feature when in edit mode.
I'm not very experienced and don't know if there is a property to disable
the scroll (in access, not in the mouse settings:) and freeze the view to one
single record ... any idea??

thanks a lot
Massimo
 
M

Marshall Barton

max said:
I have a single form which is set to allowedits = false, it is thus a form
which I call ViewMode. But the same form, through an 'edit' button, can
become allowedits = true, so called EditMode, and be used to edit records.
I've just discovered that if I click in a field and use the mouse wheel, I
can browse the whole recordset; which is nice in ViewMode, but I have to
absoultely disable this feature when in edit mode.
I'm not very experienced and don't know if there is a property to disable
the scroll (in access, not in the mouse settings:) and freeze the view to one
single record ... any idea??


I believe the DataEntry and AllowAdditions properties will
take care of all that. Setting them both to True will only
display the new record and setting them to False will only
display existing records.
 
G

Guest

I believe the DataEntry and AllowAdditions properties will
take care of all that. Setting them both to True will only
display the new record and setting them to False will only
display existing records.


Hi Marsh,

thanks for your help.
This is definively a good solution for the "NewRecordMode". But what can I
do for the EditMode? the DataEntry porperty set to yes will prevent the user
to see and edit existing records... i just need to prevent the scroll. Do
you think it is possible?

Massimo
 
M

Marshall Barton

I believe the DataEntry and AllowAdditions properties will
max said:
This is definively a good solution for the "NewRecordMode". But what can I
do for the EditMode? the DataEntry porperty set to yes will prevent the user
to see and edit existing records... i just need to prevent the scroll. Do
you think it is possible?


Sorry, I misread the original question and thought it was
only the new record situation where you wanted to prevent
scrolling.

In general, I prefer to prevent users from seeing other
records by setting the form's Record Source to a query that
only has the one record in its dataset. So the code in the
Edit button's Click event would then look like:

Me.DataEntry = False
Me.AllowAdditions = False
Me.RecordSource = "SELECT * FROM table " _
& WHERE ID=" & me.txtID

The View button would have to reset the RecordSource to your
original table/query as well as setting AllowEdits, etc.

I've never tried it, but I imagine it would also be possible
to use code in the form's BeforeUpdate event procedure that
checks a flag variable to verify that the Save button
(assuming you have one) was used or Cancel the update if it
wasn't. This way, the form will not be able to navigate
until the changed record has been saved.
 
G

Guest

Hi again Marsh,

many many thanks for your hints,
the query solution is working fine :)

cheers
Massimo
 

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

Similar Threads

wheel mouse event 3
Porting fro 2003 to 2007 - 'Mouse wheel 4
Wheel Mouse in access 1
Disable the Mouse Wheel 1
Disabling Mouse Wheel 3
Mouse Scroll Wheel 10
Disable the mouse wheel 1
Windows 10 Scrolling with mouse wheel 4

Top