BindingSource AddNew Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nev
    Contributor
    • Oct 2007
    • 251

    BindingSource AddNew Problem

    Have any of you encountered this? And how did you correct it?

    bs.addnew() automatically moves the position to the new record. But mine doesn't. I have 3 bindingsources in my program, all user-defined withevents. Their datasources come from MySQL tables. Now, in the positionchanged event, I've coded something like the one below...
    --------------------------------------------------------
    buttonAdd_clike d event handles button.click
    bs1.addnew()
    --------------------------------------------------------
    positionchanged event handles bs1.positioncha nged, bs2.positioncha nged, bs3.positioncha nged

    if directcast(bs1. current,datarow view).isnew then
    bs2.addnew()
    end if

    if directcast(bs2. current,datarow view).isnew then
    bs3.addnew()
    end if
    --------------------------------------------------------
    In my form I binded 3 textboxes for 1 field of each bindingsource.d atasource. When I click the buttonAdd, I expect all three textboxes to be blank because the positions of the 3 bindingsources will all be in the new record. What happens is that bs1 and bs3 works fine but bs2 doesn't go to the new record position.
Working...