Use the masked edit control, which are great for dates.
Alternatively, try something like (note use of validate event:
VB Code:
Private Sub Text1_Validate(Cancel As Boolean) If IsDate(Text1) Then Text1.BackColor = &H80000005 Text1 = FormatDateTime(Text1, vbShortDate) Else Cancel = True Text1.BackColor = vbRed 'or Beachbum would recommend a msgbox right here End If End Sub




Reply With Quote