Short 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
 
S

Sylvain Lafontaine

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top