Results 1 to 2 of 2

Thread: date time picker with currency manager

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2014
    Posts
    169

    date time picker with currency manager

    Code:
    Me.datetimepickerExpensiveDate.DataBindings.Add("Value", dt, "ExpensiveDate", True)
    friends
    i'm use the above connet to bind date time picker with table my problem is when
    using this code to add row
    code:
    cur.EndCurrentEdit()
    Dim cmdb As New OleDbCommandBuilder(da)
    da.Update(dt)
    the field ExpensiveDate in my data base table not get value from date time picker default value (displayed value) on a form value


    but if i select the date form date time picker
    and run the code of add

    the value inserted


    what is problem here

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: date time picker with currency manager

    I've heard others report issues with bound DateTimePickers as well, although I've not used one often myself so haven't seen the same. This may or may not help and there may or may not be a better way but try setting the Value of the DateTimePicker explicitly to Date.Today or some other value when you first create the new record.

    By the way, you shouldn't really be using a CurrencyManager directly. Add a BindingSource to your form and bind your DataTable to it, then bind that to your controls. You can then use BindingSource for all access to the bound data, including where you would otherwise use a CurrencyManager, e.g. call EndEdit on the BindingSource before saving.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width