January 10, 200323 yr Hi, To calculate the pieces in stock I have a total in stock field (=unstored calculation Purchasepiece-sum(sold)). Because of the fact that we need to search alot on this field, I made a field on the layout that can be indexed. So I made a button that updates the totals that inserts the total in stock in the indexed field I wonder what is best make a loop that goes through the whole stock and use set field or just use replace contents - relookup contents thanx Bruno
January 10, 200323 yr I think it depends on how big your database is. If it is very large, then a looping script would take a long time. It would be better to "replace with calculated result" where the calculation is simply the name of your total-in-stock field. If the db is large, then this could still take a long time, though. I wonder if there is a way to use a conditional function in a find? If you could find all records where the total-in-stock calc field is different from your working in-stock field (that is, just the records where the info has changed since the last time you updated the field) then you could relookup just the records that need it, 200 records instead of 200,000, for example. Steve Brown
Create an account or sign in to comment