Formating a Date as it is entered?

R

Russ

Is there a way to convert a date that is entered like this 120403 to
12/04/03?

In a access database you can set it so when you enter the field you get
__/__/__ and as you fill in each space only takes 2 digits.

I am looking for that type of funtionality in a form I am designing. The
users are acustomed to not typing in dashes (-, /) into a date field so if I
can find a way to achieve this functionality that would be great.
 
A

Alvin Bruney

try .ToString("##/##/##") on a date time object, see if this works for you
 
R

Russ

I tried:

txtbox.Text = txtbox.Text.ToString("##/##/##");

It would not compile saying that their were invalid arguments.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top