Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete from a grid bounded to a table

Status
Not open for further replies.

Yeap

Programmer
Jul 5, 2004
12
RO
I use a grid in a form, bounded to a table opend with exclusive=.t..
When i try to delete one record from the table with delete and than pack,
my grid gets white and i can't see anything in it(the records are no more accessible).
Why is this heappening and how can i get it? Thanks
 
Yeap

Take a look at faq184-937 and faq184-1813.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Yeap.

>> When i try to delete one record from the table with delete and than pack, my grid gets white and i can't see anything in it <<

The reason that this is happening is that PACKing the grid's RecordSource closes it behind the scenes. This rips the gri'd RecordSource out from under it and the grid has a nervous breakdown. ;-)

You do not need to pack the RecordSource to get the deleted record to disappear. If you are running with DELETED() det on, all you need to do is to move the Record Pointer and the deleted record will disappear.



Marcia G. Akins
 
Yeap,

In addition to the other good advice you've been given, you might want to look at my article, "Controlling grid data dynamically" at
You should also keep in mind that it is not usual practice to pack a table every time the user deletes some records. Because packing can take some time, and requires exclusive use, it is more common to provide a separate Pack command, usually on a private administrator's menu.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top