I'm having no luck writing an Undo button for a subform. The subform is paged so I want to put one button on the main form that does the Undo. I know I have to set the focus to the subform for this to work. Setting the focus to the subform and then .undo results in the BeforedelConfirm event being called!!
So I thought I'd try this (from the Access Help). But the ctl should surely read ctlTextbox.OldValue ? When I change it to ctlTextBox the .OldValue is the same as the .Value! The help talks about writing your own Undo, but how?!
Sub btnUndo_Click()
Dim ctlTextbox As Control
For Each ctlTextbox in Me.Controls
If ctlTextbox.ControlType = acTextBox Then
ctlTextbox.Value = ctl.OldValue
End If
Next ctlTextbox
End Sub
So I thought I'd try this (from the Access Help). But the ctl should surely read ctlTextbox.OldValue ? When I change it to ctlTextBox the .OldValue is the same as the .Value! The help talks about writing your own Undo, but how?!
Sub btnUndo_Click()
Dim ctlTextbox As Control
For Each ctlTextbox in Me.Controls
If ctlTextbox.ControlType = acTextBox Then
ctlTextbox.Value = ctl.OldValue
End If
Next ctlTextbox
End Sub