I've got a data entry form in my app. The first field is a mask edit box called mskDate, and it's set up like such in the Form Activate procedure:
mskDate.Mask = "##/##/##"
I want to make it so when the user presses the Tab key when the focus is in this field, that the current date will be assigned to the control's text property. Since Tab, as far as I know, only responds to the KeyPress Event, I tried the following which does not work:
If KeyAscii = vbTab Then mskDate.Text = Format(Now, "mm/dd/yy")
I also tried Format(Date, "mm/dd/yy") and (Date, "##/##/##")
No luck. The tab just goes to the next textbox in the tab order. Any words of wisdom would be greatly appreciated.