Textbox formating

  • Thread starter Thread starter Bobby
  • Start date Start date
B

Bobby

I have a textbox on a form that I want to display the
entered data as a date, without the user having to use a
date seperator. I've tried user-defined date formats and
user-defined number formats(to insert the seperator). But
the text always changes to the style string instead of
converting to the style string as follows:

TextBox1.Text = Format(Textbox1.Text, "MM,dd,yyyy")
 
-----Original Message-----
I have a textbox on a form that I want to display the
entered data as a date, without the user having to use a
date seperator. I've tried user-defined date formats and
user-defined number formats(to insert the seperator). But
the text always changes to the style string instead of
converting to the style string as follows:

TextBox1.Text = Format(Textbox1.Text, "MM,dd,yyyy")
.
 
-----Original Message-----
I have a textbox on a form that I want to display the
entered data as a date, without the user having to use a
date seperator. I've tried user-defined date formats and
user-defined number formats(to insert the seperator). But
the text always changes to the style string instead of
converting to the style string as follows:

TextBox1.Text = Format(Textbox1.Text, "MM,dd,yyyy")
.
The above code doesn't work, text ends up being
MM,dd,yyyy and it's the same thing with user-defined
number formats, instead of "00/00/0000" inserting the "/"
the text becomes 00/00/0000. What I want is a user to be
able to enter 01012004 and it fomat as 01/01/2004. Thanks.
 
Back
Top