|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Databinding DateTimePicker and zeroing results?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? --- Kyote 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 Show quoteHide quote "Kyote" <kyote_love@nospamhotmail.com> schreef in bericht news:cucp33dofgrgl35ha8tsb3js6jok2f7hmf@4ax.com... > 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? > --- > Kyote On Sat, 5 May 2007 21:30:44 +0200, "Michel Posseth [MCP]"
<msn***@posseth.com> wrote: > Thank you Michael. I just downloaded it and will look at the sample> >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. 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. > --->regards > >Michel Posseth Kyote On May 5, 9:47 pm, Kyote <kyote_l...@nospamhotmail.com> wrote:
> I'm using a DateTimePicker for date fields in an Access db Membership While binding the control; you can handle the Parse and Format events> 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? > --- > Kyote 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 Show quoteHide quote "D2" <dhap***@yahoo.com> schreef in bericht news:1178434700.377663.192590@y5g2000hsa.googlegroups.com... > On May 5, 9:47 pm, Kyote <kyote_l...@nospamhotmail.com> wrote: >> 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? >> --- >> Kyote > > 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. >
Show quote
Hide quote
On May 6, 12:46 pm, "Michel Posseth [MCP]" <msn***@posseth.com> wrote: correct! we usually set a default date/time for display... again when> Yes ,, > > But afaik you can`t set the control to a empty value when the db value > is a dbnull > > "D2" <dhap***@yahoo.com> schreef in berichtnews:1178434700.377663.192***@y5g2000hsa.googlegroups.com... > > > On May 5, 9:47 pm, Kyote <kyote_l...@nospamhotmail.com> wrote: > >> 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? > >> --- > >> Kyote > > > 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. saving back, check whether user has changed it or not.. if no then we set null in the db.
Show quote
Hide quote
> On May 6, 12:46 pm, "Michel Posseth [MCP]" <msn***@posseth.com> wrote: this works:> >> Yes ,, >> >> But afaik you can`t set the control to a empty value when the db >> value is a dbnull >> >> "D2" <dhap***@yahoo.com> schreef in >> berichtnews:1178434700.377663.192***@y5g2000hsa.googlegroups.com... >> >>> On May 5, 9:47 pm, Kyote <kyote_l...@nospamhotmail.com> wrote: >>> >>>> 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? >>>> --- >>>> Kyote >>> 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. >>> > 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. > http://www.codeproject.com/cs/miscctrl/NullableDateTimePicker.asp you can customize your null value. for example, i have lots of time columns that are set later. if null, they say Click To Set. in the click event, i set the value to the current time.
Fun with products and Expression columns
.net dll vs vb6 dll Delegates and AddressOf VB.NET compiler does not find type error at compiletime Comparing Alphanumeric strings C# - MS Access SQL using OleDbCommand System Menu (On Top) VB.NET 2003 Difference between Dim I as ineteger and Dim I as New Integer How do I create a Serial port listner Getting and updating columns in database |
|||||||||||||||||||||||