is there a simple way to create an "undo last action/back button" in access which will simply restore to last state? i know there is a button called "undo record" but it doesn't seem to function as i want.
my "undo" button is on main form "CLIENTS". the code ME.Undo would go in on click event of button. however, i want the functionality to undo last action in various subforms. would this require incorporating "on focus" in some way to determine which subform should have last action undone? how should vba code be altered to do this?
would i just add the following code to the button and then add "dirty" code on each of the subforms and main form?
Sub Command379_Click()
Dim ctlC As Control
' For each control.
For Each ctlC in Me.Controls
If ctlC.ControlType = acTextBox Then
' Restore Old Value.
ctlC.Value = ctlC.OldValue
End If
Next ctlC
End Sub
Private Sub Form_Dirty(Cancel As Integer)
If Me.Dirty Then
Me.Command379.Enabled = True ' Enable button.
Else
Me.Command379.Enabled = False ' Disable button.
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.