|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Verify if the editing record has changedHi,
I am using VS2005. I have a form that I use both to insert new records and modify existing records. I want that if the user tries to close the form, the application asks the user to save changes only if the record has actually changed. The problem is that if I use EndEdit, an existing record that has been modified becomes "Modified" (that's ok), but a new record after EndEdit becomes "Added", whether it has been modified by the user or not. And if some fields are not correct, it isn't possible to do an EndEdit, so I think that this must be done somewhere before the EndEdit. Is there a way to do this ? Thanks, Tom. The DataTable doesn't differentiate between a new record that has been
added, and a new record that has been added and also modified by the user (i.e. the record does not just have default values). If you want to be able to differentiate between these two different types of new records, you need to write your own data source. Otherwise, I imagine you would have to loop through every field to see whether or not they all have their default values (user hasn't modified it) or at least one field has a non-default value (user modified it). Show quoteHide quote "Tom Bianchi" <a@b.c> wrote in message news:uqU1fvqRGHA.1204@TK2MSFTNGP12.phx.gbl... > Hi, > > I am using VS2005. I have a form that I use both to insert new records and > modify existing records. I want that if the user tries to close the form, > the application asks the user to save changes only if the record has > actually changed. > The problem is that if I use EndEdit, an existing record that has been > modified becomes "Modified" (that's ok), but a new record after EndEdit > becomes "Added", whether it has been modified by the user or not. And if > some fields are not correct, it isn't possible to do an EndEdit, so I > think > that this must be done somewhere before the EndEdit. > Is there a way to do this ? > > Thanks, > Tom. > >
Adding Button Programmatically REDUX - STILL NONFUNCTIONAL
VB.NET Automatic code typing features "ambiguous" problem with VB.NET 2005 ComboBox ReadOnly Direct input into DataGrid? Help with first multi-thread app pls? Please help! Database won't update Visual Basic .net and DirectX Access a textbox on a report form From Windows application to ASP.Net Web Application |
|||||||||||||||||||||||