Cancel Changes

I

inadsad

Greetings Group:
I got a form with multiple controls that are bound to a dataset, with
two buttons & next/previous. Simply, add button adds a new record and
cancel button undo changes.

On add click event button:
Me.BindingContext(ds1.Tables("MyTable")).EndCurrentEdit()
Me.BindingContext(ds1.Tables("MyTable ")).AddNew()

On Cancel
Me.BindingContext(ds1.Tables("MyTable ")).CancelCurrentEdit()
''''' -> ??? ds1.Tables("MyTable ").RejectChanges()

Issue is that after click on Add the CancelCurrentEdit() undo changes
on some records as I do the next & previous. If I keep both
Cancelcurrent and Rejectchanges then it seems to restore back to
original Ok. Why do I need both? Help!

Ian
 
C

Cor Ligthert [MVP]

InAdad,

The EndCurrentEdit pushes the data in the last used control into the
datatable
The RejectCurrentEdit undo's that probably, it is an instruction I never
used.
The Acceptchanges set all the set all rowstates to the ones they are
The Rejectchanges does the same after setting back the values to those after
the latest acceptchanges or fill with acceptchanges on after filling
(default setting)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top