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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On my userform I have a box where t

Status
Not open for further replies.

Navvy

Technical User
Apr 12, 2002
64
US
On my userform I have a box where the user has to enter a date in the following format:

dd/mm/yy

Is there any way to prompt the user to type in the date in that format, i.e. --/--/-- where the user can only type over the "--"?
 
I would allow the user to enter the date as they normally would (I know people tend to do this differently) and then format the date as I need in the code:


Private Sub txtTextBox_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
txtTextBox.Value = Format(txtTextBox.Value, "dd/mm/yy")
End Sub


********************
What's the best way to get the answers you need?? See FAQ222-2244 for details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top