Temporary Tables

Firstly I apologise if this question has been asked already, I did search but nothing came up for my exact scenario. I have a form with reference to a source table. On this form is it possible to have a sub form referencing a temporary table, I know how I can successfully open another form with the temporary table but not as a sub form.

Hi, No, its not possible to reference a sub form with a temporary table. The table needs to be a Physical table created. Regards Suresh.

Sorry, but this is not possible. [V] You could use a TableBox control instead of a subform control though. [;)]

Lees, I know can force a form to act as if it was using a temporary table as follows (this data should be added to the form): OnFindRecord(Which : Text[1024]) : Boolean Temprec := Rec; IF NOT Temprec.FIND(Which) THEN EXIT(FALSE); Rec := Temprec; EXIT(TRUE); OnNextRecord(Steps : Integer) : Integer Temprec := Rec; CurrentSteps := Temprec.NEXT(Steps); IF CurrentSteps <> 0 THEN Rec := Temprec; EXIT(CurrentSteps); You could try adding this code to a subform and see if it works, I haven’t time to play with it myself I’m afraid. Hope this helps. Alex

Andrew, If I understood your question correctly I think it is possible to run a subform on a temporary table. Try adding a function to the subform that has a parameter of the temporary table passed by reference. The subform should have a global variable of the temporary table also. In the function you iterate through the parameter version of the temp table and transfer all of the records to the subform global variable version. In the main form you can build a temp table with the data you want then use this new function to pass it through to the subform version of the temp table. Then you can use the code in the OnNextRecord and OnFindRecord suggested by Alex above to make the subform display the temp table records. Unfortunately the only example of this I have got is in a heavily modified database so I can’t really send you through some demo objects that would go into cronus but I hope this helps with you problem. Regards, Chris.