I have a simple form where a user can view or modify data in a table. I have disabled the X on the menu bar to stop them exiting and provide two VBA buttons, one for save/exit and another for abandon/exit.
On exit, there is a routine which needs to check if a field was modified and update a change log:
Expand|Select|Wrap|Line Numbers
- Private Sub CloseFS_Click()
- If Me.EA <> Me.EA.OldValue Then UpdateHistory Me.EA
- End If
- End Sub
I have also tried DLookup but it appears that the field change is updated in the database on modifying another field. Can this behaviour be changed/controlled?
Is there a more reliable way to check if a field has been changed since the form was opened as you close it? (without simply creating a change variable)
Also, can I be sure no field will be modified on closing with the following abandon code?
Expand|Select|Wrap|Line Numbers
- Private Sub Abandon_Click()
- Me.Undo
- DoCmd.Close , , acSaveNo
- End Sub