When this pice of code determines that the user has entered a 'No' response it resets the 'Next Call Date' field to it's previous value. What it doesn't do is stop the action that the user took immediatley after changing the 'Next Call Date'. For example, the user can change the date then immediatley click on a button to exit the form. The code below stops the update of the field but not the exit. How do I do this?:
Private Sub NEXT_CALL_DATE_AfterUpdate()
If (Forms![Contact Information]![NEXT CALL DATE] > DateAdd("m", 6, Date)) Then
If (Eval("MsgBox(""You have entered a date that is greater than six months away. Is this correct?"",4,""Please confirm date.""=7") Then
DoCmd.CancelEvent
DoCmd.GoToControl "NEXT CALL DATE"
Forms![Contact Information]![NEXT CALL DATE] = Forms![Contact Information]![NEXT CALL DATE].OldValue
Else
End If
If (Eval("[Forms]![Contact Information]![NEXT CALL DATE] Is Null") Then
End If
Else
End If
End Sub
Many thanks in advance.
Quote for the day: "If that 'New!' washing powder is so good, does that mean the old one was rubbish?"
Private Sub NEXT_CALL_DATE_AfterUpdate()
If (Forms![Contact Information]![NEXT CALL DATE] > DateAdd("m", 6, Date)) Then
If (Eval("MsgBox(""You have entered a date that is greater than six months away. Is this correct?"",4,""Please confirm date.""=7") Then
DoCmd.CancelEvent
DoCmd.GoToControl "NEXT CALL DATE"
Forms![Contact Information]![NEXT CALL DATE] = Forms![Contact Information]![NEXT CALL DATE].OldValue
Else
End If
If (Eval("[Forms]![Contact Information]![NEXT CALL DATE] Is Null") Then
End If
Else
End If
End Sub
Many thanks in advance.
Quote for the day: "If that 'New!' washing powder is so good, does that mean the old one was rubbish?"