Hi
I am formating a TextBox with the following code
Code
Private Sub TextBox2_AfterUpdate()
'RegDate = TextBox2.Text
'TextBox2 = Format(RegDate, "dd-mmm-yy")
With TextBox2
If IsDate(TextBox2.Value) Then
TextBox2 = Format(TextBox2, "dd-mmm-yy")
Else
.Text = ""
MsgBox ("Please Enter a Vaid Date")
Cancel = True
TextBox2.SetFocus
Exit Sub
End If
End With
End Sub
Display More
However if I put a date of 31/06/16, instead of displaying the MsgBox it Give a date of 16-Jun-31
Can anyone help please