I have tried putting the setfocus statement in the following control.
That does indeed reset the focus back to the previous control, but
because the Afterupdate event has already been triggered I receive the
msgbox dialog again and then the focus moves back to the following
control.
However, your suggestion prompted me to look at the BeforeUpdate event,
and with the following amended code this works purfickly....
Private Sub txtCourseDate_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)
If IsDate(txtCourseDate.Value) Then
txtCourseDate = Format(txtCourseDate, "dd/mm/yyyy")
Else
MsgBox ("Invalid date format, please use 'dd/mm/yyyy'")
txtCourseDate.Value = ""
Cancel = True
End If
End Sub