Prevent Next record button from saving previous

JayJay00

Registered User.
Local time
Today, 21:30
Joined
Jun 12, 2011
Messages
40
Is there a way that i can when switching from one record to another on a form to prevent it from saving the previous record.

The problem comes when i have a check box for each record. The form is based on a query that only shows those that are unchecked. So once checked and moved on to the next record. Im guessing the form still shows the record as it hasn't been closed but doesn't allow you to edit it.

So i want it to not save on changing records so that IF a mistake was made on the form. They could uncheck it after changing records

If that makes sense

Thanks
 
Last edited:
Why won't it let it be edited? It should be able to be unless you have it set in the Form's On Current event to set Allow Edits to false when it isn't a new record.
 
Yeah. The concept in Access is that a record is saved automagically if a). there were any changes, and b). you for any reason leave the record or form. The way to deal with this is NOT to save a faulty record and then rectify it, but to do whatever checks are necessary in the BeforeUpdate event of the form, and Cancel the update. But, this still leaves you with a changed record. To be able to "escape" from it, the BeforeUpdate event must also undo any changes, which is pretty easy using Me.Undo. First then can you leave the record without it getting saved.

Search for BeforeUpdate in the forum - there are plenty of cases
 
I have the following code on the check box to remove stock when the ink/toner request is ticked off as 'Done'

Private Sub Done_AfterUpdate()


If Me.Done.Value = True Then
If [Current Stock] <= 0 Then

[Current Stock] = MsgBox("No stock available", vbOKOnly)
Me.Done.Value = 0
Else
End If
Me.Current_Stock.Value = [Current Stock] - 1
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End Sub

Could the 'Undo' part be causing the issue?

Its there so that if someone accidently ticks a job then they can untick it and the stock be put back up.

I tried it with the adding 1 to stock if it was unticked but then you could add stock when the stock level was '0' so it would throw the stock figures out.

Its only a minor issue we had after putting it out on the network today. Its the only one its had and its nothing major.. just want my system to have 0 flaws
 

Users who are viewing this thread

Back
Top Bottom