Seasonal Greetings . i have a small procedure error . The scenario is when a states is change to Booked . After update, actions programmed work as expected. I now wish to place a before update question and if the answer is Yes the sub is exited, without saving the status Booked.
When running the sub the before update runs first and then carry's on to the after update actions, when i wish it to exit the sub and not saved the booked status.
Advise would be appreciated.
Regard Ypma
Code:
Private Sub Status_BeforeUpdate(Cancel As Integer)
If Me.Status = "Booked" And IsNull(txtVulnerable) Then
If MsgBox("Is this client Volnerable", vbYesNo + vbQuestion) = vbYes Then
MsgBox "You have checked Yes. Now complete the volnerable text box"
End If
End If
Exit Sub
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Me.txtVulnerable.SetFocus ' VBA Command to be executed if Yes is selected
End Sub
When running the sub the before update runs first and then carry's on to the after update actions, when i wish it to exit the sub and not saved the booked status.
Advise would be appreciated.
Regard Ypma
Last edited by a moderator: