Hi everyone,

I last sent a message in the newsgroup reporting data loss, and I have now
at least found one reason for this, which I will try to explain.

I have a data entry screen which has a header with dbforms. The main detail
area is a dbgrid. I have a augmented the child_entering function to add a
row to the dbgrid depending on a change of value in one of the header forms.

If I find a record in the header it populates the dbgrid with current child
records. I then change a value in the header and click onto the dbgrid. This
triggers the child_entering function to add a new row with the following
code:

Send Add_New_Row of oDetailGrid 1
Get Current_Row of oDetailGrid to iItem

Set Changed_Value of oDetailGrid item (iItem) to sTag
Set Changed_Value of oDetailGrid item (iItem + 1) to sTag
Set Changed_Value of oDetailGrid item (iItem + 2) to sInd
Set Changed_Value of oDetailGrid item (iItem + 3) to sData

Send Beginning_Of_Data of oDetailGrid


The problem is that the current_row value is never the new row I just added.
It always overwrites the data in the last row which already had record
information. Is this a bug?

The reason I ask is that if I follow the procedure above, but after
initially finding a record in the header I actually click onto the dbgrid
and then click back onto the header again to change a value it actually
finds the current_row as the actual row I just added.

I hope that makes sense and that someone can come up with a reason on why I
have to click on the dbgrid first to stop the last record in the dbgrid
being overwritten.

Thanks for your time.

Richard