Hi Andrew,
You can use the Exit event of the textbox to check the format:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox1.Text) Then
MsgBox "Ey! Gotta be a date here."
TextBox1.SelStart = 0
TextBox1.SelLength = Len(.Text)
Cancel = True
End If
End Sub
--
Mark Tangard, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters
> I have set up a user form to populate a document with the answers and
> everything is fine.It all works. Now hoever, I would like to know if
[quoted text clipped - 8 lines]
>
> Andrew Hargreaves
harg7769@lineone.net - 17 Oct 2003 10:41 GMT
Excellent MArk, I'll give that a go.
Thanks
Andrew
>Hi Andrew,
>
[quoted text clipped - 8 lines]
>End If
>End Sub