Hi, can anyone tell me how to set the masked edit control format as short date format in Excel VBA?
I have VB. code as follows:
Private Sub DTPickerActual_Change()
MskEd4.Text = DateAdd("d", -4, DTPickerActual.Value)
MskEd10.Text = DateAdd("d", -10, DTPickerActual.Value)
MskEd30.Text = DateAdd("d", -30, DTPickerActual.Value)
MskEd60.Text = DateAdd("d", -60, DTPickerActual.Value)
I can not tell what is wrong with this code. In the Date/Time picker control property, I set format as 1-dtpShortDate. And I checked the interval argument in DateAdd Founction, "d" is set as DAY. But how come I will get both date and time in the masked edit text box? I also try to put "y" instead of "d", it remains the same. Is there any setting I need to take care in the masked edit box properties? I just want those masked edit boxes display the date not the time.