Short Date

  • Thread starter Thread starter Vadim Rapp
  • Start date Start date
V

Vadim Rapp

On a form, I have textbox bound to datetime column on the server. The column
may contain time as well, but I don't want to see it on the form. I specify
Format="Short Date". Then it shows up without the time, but as soon as it
gets focus, the time shows up. Is there a way to avoid it? I've put

Private Sub D_GotFocus()
If CLng(D) <> D Then D = CDate(Split(CStr(D))(0))
End Sub

but maybe there's some trick to achieve the same without coding? specifying
decimal places=0 as well as specifying input mask don't have any effect.

Vadim Rapp
 
You must make sure that the time is already set to 0 (or midnight) on the
backend table. In your case, your are setting it to 0 on the control after
the control has already begun the edition of the value; I don't think it has
the same effect.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
Back
Top