hi guys I am using the below code on textbox 1 (userform) that runs smoothly doing what it is supposed to do, what I need is some code that will check the date format in textbox1, to ensure it is entered as dd/mm/yyyy, if correct then run the afterupdate code if not then show a message asking the user to enter the date correctly, I also have some code that copies all the data from the userform to another sheet on a command button, could some code here highlight if the format is not correct before copying
Private Sub TextBox1_AfterUpdate()

If Me.TextBox1 <> "" Then
Me.TextBox22 = Application.WeekNum(CDate(Me.TextBox1), 2)

End If

If Me.TextBox1 <> "" Then
Me.TextBox23 = Month(Me.TextBox1)

End If

If Me.TextBox1 <> "" Then
Me.TextBox24 = Year(Me.TextBox1)

Me.TextBox25.Value = DatePart("q", Me.TextBox1.Value)

End If

End Sub
scouse13