How not to write a record in MS-Access?

I have a linked form in Microsoft access that allows a user to add data to a table. I want to put the cancel button on the form, which, if clicked, will stop the recording obligation.

What do I need to cancel a recording obligation?

+4
source share
2 answers

Several years have passed since I had to work with Access, but you should be able to discard the changes in the current record using the command:

DoCmd.RunCommand acCmdUndo 

or

 Me.Undo 

?

+5
source

I have a similar situation where I want the user to confirm whether to save the changes and use the BeforeUpdate form to ask the user if they want to save the changes. This seems to work very well, at least in my case.

 Private Sub Form_BeforeUpdate(Cancel As Integer) If MsgBox("Do you want to save changes?", vbYesNo, "Confirm change") = vbNo Then Cancel = True Else 'Do Nothing End If End Sub 
+1
source

Source: https://habr.com/ru/post/1302787/


All Articles