cerins4ever
New Member
- Joined
- Jun 5, 2014
- Messages
- 35
Hi guys!
I have problem with data entry in text box.
I wanto to entry date lika 08.09.2014 or 08/09/2014, but if i entry other info. lika text abd or number 12.5 i need to textbox show that i have wrong info.
I have code wich work only with numbers but not with date
I have problem with data entry in text box.
I wanto to entry date lika 08.09.2014 or 08/09/2014, but if i entry other info. lika text abd or number 12.5 i need to textbox show that i have wrong info.
I have code wich work only with numbers but not with date
Code:
Private Sub TextBox7_Change() If TypeName(Me.ActiveControl) = "TextBox" Then
With Me.ActiveControl
If Not IsDate(.Text) And .t <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
.Value = vbNullString
End If
End With
End If
End Sub