Databinding DateTimePicker and zeroing results?

  • Thread starter Thread starter Kyote
  • Start date Start date
K

Kyote

I'm using a DateTimePicker for date fields in an Access db Membership
app. Some of the date fields are empty, meaning they haven't been
filled out yet, or they cannot be. But when a record is read with
empty fields, their connected DateTimePicker's display the current
date.

Is there any way to have the DateTimePicker show as empty/blank?
 
You might investigate my date entry control

wich can handle db nulls and show a empty box and lots and loots more (
investigate the property`s of the control )

http://www.vbdotnetcoder.com/Downloads/Examples/AuthorMP/dateentry.zip

i wrote this control for the company i work for , for simple date entry
while still providing data binding ( the controls takes any entry that is
valid for cdate , 1-1 , 1 jan etc etc etc )
it comes with a sample project and full sourcecode.

regards

Michel Posseth
 
I'm using a DateTimePicker for date fields in an Access db Membership
app. Some of the date fields are empty, meaning they haven't been
filled out yet, or they cannot be. But when a record is read with
empty fields, their connected DateTimePicker's display the current
date.

Is there any way to have the DateTimePicker show as empty/blank?

While binding the control; you can handle the Parse and Format events
of the binding object. In your event handlers, your can set a
different value(default value when database has null). Right now i
dont have the sample code, you can find good samples at msdn.
 
Yes ,,

But afaik you can`t set the control to a empty value when the db value
is a dbnull
 
Yes ,,

But afaik you can`t set the control to a empty value when the db value
is a dbnull

correct! we usually set a default date/time for display... again when
saving back, check whether user has changed it or not.. if no then we
set null in the db.
 
You might investigate my date entry control

wich can handle db nulls and show a empty box and lots and loots more (
investigate the property`s of the control )

http://www.vbdotnetcoder.com/Downloads/Examples/AuthorMP/dateentry.zip

i wrote this control for the company i work for , for simple date entry
while still providing data binding ( the controls takes any entry that is
valid for cdate , 1-1 , 1 jan etc etc etc )
it comes with a sample project and full sourcecode.

Thank you Michael. I just downloaded it and will look at the sample
project in a few minutes. From your reply to D2 I think you understand
exactly what I'm trying to do and that this will indeed solve my
problems.
 
Back
Top