Formatting a masked Text box
-
I have a masked text box that displays a date dd/mm/yyyy e.g. 01/03/2007 When I try and change the format to read yyyy-mm-dd, it displays yyyy-mm-dd and not 2007-03-01 If it was any ordinary text box the syntax is format(MyDateField.Text, "yyyy-mm-dd") and it works. It does not when the text box is masked. I must be doing something stupid or missing syntax. How do I get a masked text box to format correctly as above?
-
I have a masked text box that displays a date dd/mm/yyyy e.g. 01/03/2007 When I try and change the format to read yyyy-mm-dd, it displays yyyy-mm-dd and not 2007-03-01 If it was any ordinary text box the syntax is format(MyDateField.Text, "yyyy-mm-dd") and it works. It does not when the text box is masked. I must be doing something stupid or missing syntax. How do I get a masked text box to format correctly as above?
Have a look at the datetimepicker control, could this handle your requirements better? MSDN: Datetimepicker control[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch