Solved

Formatting a text box for a Date

Posted on 2001-08-14
6
149 Views
Last Modified: 2010-05-02
i have a text box on a form where i would like users to enter in a date. ie.  08/14/2001. I would like to have the "/" already in the text boxes so users would only have to enter in the numbers. Any suggestions?
0
Comment
Question by:Maxim10553
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
Otana earned 50 total points
ID: 6384461
use the Microsoft masked edit control. set the inputmask to ##/##/####.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6384509
masked edit control (as stated by Otana)

or

calendar control

or

Use three Textbox's

and/or

trap the Textbox's keydown event.. testing for only numeric entry.. along with a test for the length of the entered text.. so that you can then dynamically add the slashes where they belong.
0
 
LVL 3

Author Comment

by:Maxim10553
ID: 6384579
thanks guys. exactly what i was looking for
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Author Comment

by:Maxim10553
ID: 6384605
hey, one more thing. what about a price format. any suggestions on that? guessing the input mask has to be dynamic in nature. ie $10.10, $1000.10, $ 10000.10
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6384855
Tip.. Dollar signs only make your data harder to read.. cluttering your presentation. If a field is dollar.. place the dollar symbol in a Label caption next to your text box.
0
 
LVL 3

Author Comment

by:Maxim10553
ID: 6384965
thanks, threw some points up for you. will try what you said
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now