>I have a cursor I created (by select ... where .f. readwrite), and it's to be the recordsource of a grid on page2 of a pageframe. There's a listbox on page1 where a selection causes the following:
>
>1. a record from the table is loaded into a couple of objects, to be shown on page1
>2. the cursor for the grid is zapped
>3. a bunch of records is inserted into the cursor
>
>Then the user can go to page2. The grid on page2 is in a container which is instantiated on first use.
>
>The 2027 error appears on second or later inserts. The records to be inserted appear in separate cursors in the Data Session view. From what I saw in other threads about this error, it happens when there's a grid with a cursor like this. Now this cursor has no buffering at all, and I've moved the focus off the grid - no luck. Next thing I tried was to simply removeobject(container) from page2 whenever it deactivates, so when this happens the grid actually doesn't even exist. And I'm still getting this error.
>
>I've also tried to unbind the grid (by setting its recordsource to "") before destroying it, no luck. Setting its buffering to 5 then 1 then 5 during this, with tablerevert() etc also doesn't work - still get 2072.
>
>If anyone has more ideas, welcome.
if this work, try to minimize this code until it work
grid.visible = .f.
grid.enabled = .f.
zap
grid.refresh
insert ...
grid.refresh
grid.enabled = .t.
grid.visible = .t.
A drastic solution is:
grid.recordsource = grid.recordsource