>1. I dont know where to put the append blank. What I want is when the user clicks the grid for the first time
>a blank record should be added and then when he presses down arrow more records should be added. He
>will also have the freedom to click on the deleted mark to delete one or all of the child records. All this facility
>is only in add mode which I keep track by setting a flag as soon as he clicks add button.
For the APPEND BLANK:
SELECT MyChildTable
APPEND BLANK
New records in grid: implementing your functionality for adding new records in grid is ratter hard to program. You need to add code in the GotFocus() and the AfterRowColChange() of the grid. A better approach will be to put a Add button beside your grid.
>2. I have included a On Error errflag = .t. statement as Mr. Eric has suggested in one of a previous thread. But
>it is not going to the roll back as far as the master table is concerned. So I end up with a master record without
>a child record
TableUpdate() won't trigger the ON ERROR when it fail if record or table buffering is enabled. TableUpdate() will return .F. in that case, so you could check:
IF NOT TableUpdate()
WAIT WINDOW "Save not commited"
ENDIF