Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time using masked edit control

Status
Not open for further replies.

rschkrt

MIS
Apr 24, 2002
13
US
When entering the time, I wanted to use the masked edit control but having a problem. When enter a time example: 10:15:00 AM. How would I mask it? Thank you.

 
Try MyStr = Format(MyTime, "hh:mm:ss AMPM") If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
The mask property of the control can be set to ##:##:## ??. However, the control can only distinguish between numbers and letters. The user could enter 99:99:99 XX. You would still have to validate the time with the IsDate() function.

If you are going with an ActiveX control, try the DTPicker in the Common Controls and set the format property to 2 (dtpTime). This provides a text box with and Up/Down control and the user can only enter a valid time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top