Code:
Option Compare DatabaseOption Explicit
Private Sub Field1_AfterUpdate()
MsgBox "Field1 afterupdate fired"
Field1.Enabled = False
Field2.Enabled = True
End Sub
Private Sub Form_Current()
Field1.Enabled = True
Field2.Enabled = False
End Sub
Private Sub Form_Undo(Cancel As Integer)
Field1.Enabled = True
Field2.Enabled = False
End Sub
Private Sub UndoEntries_Click()
MsgBox "UndoEntries click"
Me.Undo
End Sub
I've diagnosed the problem but not the solution:
Add the two msgbox lines and you will see the problem.
If the cursor remains in Field1 when the UndoEntries button is clicked, the Click event does not fire, the Field1_afterupdate does!!
The second time the button is clicked, it fires as expected.
However, if you tab out of field1 before clicking the button, it also fires as expected.
Anyone have any insight as to why the click event is ignored?