However I find it just too easy to accidentally modify records on my Form as Base autosaves a record if I move to another record (I am using a table subform so it's easy to move from one record to another). I want a feature that displays a confirmation YES/NO MsgBox and if you enter NO then it doesn't save the record and puts the old data back.
I did this in Access using a macro on the 'Before Update' event. I tried to do the same in Base on the 'Before record change' event but I found this event is triggered several times on opening up the Form and again several times when moving to another record and even closing the table. I just want it to ask once!
This is what I have been trying:
Code: Select all
Sub confirmInsert(event as object)
confirmInsert=True
If MsgBox("Update Record?", 4,"Confirm")=7 Then
confirmInsert=False
rem NEED AN UNDO ACTION HERE
End If
End sub
Isn't this sort of protection something quite basic in databases? I would have thought there would be an easy inbuilt solution to this.
Any help much appreciated.