Editing a textbox with a smalldatetime control source shows date and time

  • Thread starter Thread starter Wes Peters
  • Start date Start date
W

Wes Peters

How can I change the format of a textbox that has a smalldatetime control
source so that only the date appears when it needs to be edited? Currently
both the date AND time show up.

Thanks,
Wes
 
The time must be set to zero; otherwise it will show up.

If you want to keep a time part different from zero, then you need to use 2
fields (one for the date, the other for the time) or use unbound fields and
manipulate them in the OnCurrent and OnBeforeUpdate events.

S. L.
 
OK, Thanks. I see how that works now.

I have a field that has a default value of getdate(). All I want is the
date portion. Is there any way to capture just the date portion if the
default value is used?

Thanks
 
Yes, use something like:

Convert (char (10), getdate(), 102)

or: Convert (DateTime, Convert (char (10), getdate(), 102))

S. L.
 
Back
Top