Kayleigh
Member
- Local time
- Today, 05:16
- Joined
- Sep 24, 2020
- Messages
- 709
I know there are loads of suggestions on this problem but I am looking for a simple solution to implement.
The structure of the forms are very basic (both single forms):
Parent form = details of Tenancy
Child form = details of Tenant
I would like to have a cancel button on parent form which would reverse all updates on both these forms.
Code I tried was:
But error flagged up ctrl.value = ctrl.oldvalue that it can't assign value to this field??
The structure of the forms are very basic (both single forms):
Parent form = details of Tenancy
Child form = details of Tenant
I would like to have a cancel button on parent form which would reverse all updates on both these forms.
Code I tried was:
Code:
If MsgBox("Are you sure you wish to discard changes?", vbOKCancel + vbQuestion, "LuxerMan") = vbOK Then
Me.Undo
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.ControlType = acTextBox Then
ctrl.Value = ctrl.OldValue
End If
Next
DoCmd.Close acForm, Me.Name
Else
Exit Sub
End If