Re: IF Statement
The logic of the code is still off an insert will not take place should it be a new record.
Personally I think I would set up some kind of list that would hold the row numbers that had been changed since the data was last saved then go through that list and update the records which were changed. It is kinda silly to loop through all the items in a grid and do a select for every row. What if the user changed only 1 record but it was the last row and there were 10,000 rows? You would be doing 9,999 selects that do not need to be done before you get to the right one. Where if you had just stored the row number when the user changed it you could do the same task with a single select statement and it would be much much faster.
Always use [code][/code] tags when posting code.