Refresh

In a table box control, i put some text box controls (they are not fields) to display calculated values (by putting codes OnAfterGetRecord trigger), i have problems with the first and last record when displaying in Maximise mode or go from Normal to Maximise, in the last record all of my calculated values are of the first record’s, they are only updated when i move cursor to that last record, move away and back again. Has anyone experienced that problem

Check the TableBox-Properties “HorzGlue” and “VertGlue”. Maybe your problem could be solved if you set the values to “Both”!? Joerg Stryk

Thank you Joerg, i did setup HorGlue and VerGlue properties to Both, it did not work, but your idea about property let me check again the form properties and i set TableBoxID and it works. Thanks again.

Generally your approach - to set global variables at OnAfterGetRecord and display them a table-box - is wrong. Why? Well, the table-box shows 10-20 records but you only have ONE variable! What does that mean? Whenever you have a refresh of the form (currform.update) the row with the global variable will show the same value in all rows. The better solution is be to create a function which you display as source-expression of the row. A stupid and simple example: Let’s assume you have a table with the fields “Amount with Tax” and “Amount without Tax”. Now you want to display a row with a calculated “Tax”. If I understand you correctly, you have defined a global variable “Tax” : Decimal and you define … OnAfterGetRec Beging Tax := “Amount with Tax” - “Amount without Tax”; End; Instead, you could create a function “getTax” with the same functionality and set “getTax” als Source expression of the Tax-Column. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch