Hi, I have a userform where a user can enter a date in the textbox on the userform, and so the data is entered in the table once the user clicks OK on the userform. I am just wondering is there a VBA code which can limit the user to only entering the date in a format such as ##/##/####, in the following order ; day, month, and then year. If he/she enters a different format and clicks on OK on the userform to enter, then can a message box pop up warning the user that the data should be entered in proper format.

So far, I have constructed the following If statement )see below), but it is not working, can anyone please help me?

If Trim(Me.TextBox_Order_Date.Value) <> "##/##/####" Then
Me.TextBox_Order_Date.SetFocus
MsgBox "Please enter date in proper format"

Exit Sub

End If