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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid problem

Status
Not open for further replies.

budz

Programmer
May 3, 2001
17
hi everybody, I have a form with a grid with recordsource dbf and a add command bottom and a save to diskette command bottom.

At add command bottom, I have do form add (for data entry).

At save to diskette command bottom, When I save all the data in a disk, i must zap the dbf. Then refresh the grid.

My problem is that the width of each column in the grib is not the same as before.

Thanks for the help
 
As has been related in other threads, the key to this situation, is to unlink your recordsourse before the ZAP, and remake it afterwards.

lcSaveRS = ThisForm.grid1.recordsource
ThisForm.grid1.recordsource = ""
...
ZAP
...
ThisForm.grid1.recordsource = lcSaveRS

This should leave your grid and all it's settings intact.

Rick
 
thanks Rick, but where should I put this code
 
In the form method that is currently doing the ZAP (the form that has the grid). If you are doing the ZAP in an external .PRG file or another form, then 'bracket' the calling code to this with the save / restore recordsource code.

Rick
 
In your save to to diskette command button, since that's where you say you need to zap the .dbf. Rick's code is just a wrapper around whatever code you've already got there. Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top