View Full Version : Formatting TextBox
Hello
can i Format TextBox to Appear with date Format
to show the user
/ /
and don't accept any kind of data Just date
http://www2.0zz0.com/2009/05/19/11/690928094.gif
this Picture Declare what i mean
Bob Phillips
05-19-2009, 04:50 AM
This is incredibly convoluted, you have to parse what has been input previously, chcek what is entered, handle a delete, handle a backspace and so on. Far simpler to have three dropdowns in my view where they choose a year,. a month and a day.
i see that xld
thanx for your suggestion
but can i make just the date inter in my textbox
i mean when any one try to write normal number excel refused it
Bob Phillips
05-19-2009, 05:25 AM
You could check it on AfterUpdate as
Private Sub TextBox1_AfterUpdate()
With Me.TextBox1
If Not IsDate(.Text) Then
MsgBox "Error"
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End If
End With
End Sub
can i ask u xld, please
what we mean by
.SelStart = 0
.SelLength = Len(.Text)
Bob Phillips
05-19-2009, 07:46 AM
What that does it to reselect all of the text from character one, this is when it errors so that the users attention is drawn to the bad data.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.