>>>>>>>>>I have a grid based on a view.
>>>>>>>>>When the user click on the new command button, the system display a modal form for him to enter the information.
>>>>>>>>>After the modal form is closed, a INSERT-SQL is done in the buffered table, a Requery() is perfomed on the view and the grid is refreshed.
>>>>>>>>>My problem is that the grid doesn't show the new record until the new record is commited to the table.
>>>>>>>>>I want the grid to show all records, buffered or not.
>>>>>>>>>How can I do that?
>>>>>>>>
>>>>>>>>You can APPEND new record to view only without Insert-SQL to underlying table. This case (I assume you use Table buffering) you will see non-commited record in grid, although it's not in table yet.
>>>>>>>
>>>>>>>I can't append the view, because:
>>>>>>>A) The view don't have all the fields of the original table
>>>>>>>B) The view is based on joined tables and only one need to be updated
>>>>>>
>>>>>>For the A clause, it doesn't matter if you don't have all the fields but, you must
>>>>>>have all the fields that represents the primary key of the table.
>>>>>>For the B clause, If you want to append just 1 table. You should check the update
>>>>>>checkbox for only the fields of the desired table.
>>>>>
>>>>>I included all the fields in the view and made them all updatable (except for the fields of the other table).
>>>>>Then, I issued an APPEND on the view and REPLACEd the fields.
>>>>>
>>>>>Guess what? It's worst! Now, not only I don't see the added record in the grid, it's never commited to the table!
>>>>>
>>>>>I guess the view will commit the change on the next TABLEUPDATE(), but I don't want to issue it right now because the user can still revert it's change at this time.
>>>>>
>>>>>Maybe I will look at the BEGIN/END TRANSACTION commands.
>>>>>
>>>>>Is this my only alternative?
>>>>
>>>>Did you Grid.Refresh after Append the record? You should give some credit to MS Foxpro team, most of things they do all right.
>>>
>>>Yes, I did a Grid.Refresh() after the APPEND
>>
>>Then you must see new record in grid..., or it's just a bad day.
>
>I removed my Requery().
>Now it *does* show a new record, but blank!
>
>My code goes like this:
>SELECT MyView
>APPEND BLANK
>REPLACE Field1 WITH SomeValue
>...
>REPLACE Fieldx WITH SomeValue
>THISFORM.MyGrid.Refresh()
>
>After the Refresh(), I see a new blank record. If I quit the application and go back to the grid, the new record will be there.
>
>Any suggestions?
Keep trying. When you see 'blank' record, click on this grid row and look at debug window checking e.g. Grid.ColumnX.Text1.value
Edward Pikman
Independent Consultant