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

VFP 7.0: Grid: Recalculation delayed

Status
Not open for further replies.

Kimed

Programmer
May 25, 2005
104
LT
Hi,

In my form I have a grid that I'd like to monitor at the time of data input. I have a group of textboxes that show various calculated summaries of data - sums per columns, absence or presence of certain values, etc. For any cell, Valid event launches a procedure that scans the table, makes all calculations, writes results into textboxes' values, and then refreshes the form. The final effect is similar to formula calculation in Excel. To avoid repositioning of the active cell, all scanning happens in the alias of the same table.

The problem is that refreshed values are shown not immediately after leaving the cell, but after leaving the *next* cell having the same Valid, even if I don't change *that* cell's content. I vaguely suspect that it has something to do with using alias table for scanning instead of the original, so that it refreshes later, but I don't know how to avoid it. I might remember RECNO of the current record, scan the original table and then GOTO back, but I suspect that it would make the grid "jump", and I'd like to avoid it.

Any ideas? Thanks.
 
You may be using some buffer mode and/or multilocks (recordlocks). Have a look at the help topics on TABLEUPDATE(), FLUSH and SET REPROCESS TO.

Bye, Olaf.
 
Nope, I've figured it out. It was because the table is only updated *after* Valid returns positive verdict and recalculation procedure was launched from Valid itself. I moved it into AfterRowColChange and now it works OK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top