Retrieving records from the displayed subform.

Hi all, In main form, when ‘code’ is selected, corresponding records are displayed in subform. Now, I want to retrieve only those records which are displayed, to add field values rather than scanning through whole table by using SETRANGE and FIND function for any ‘code’ selected. Thanks, Uday

hi, you can define a record variable of the same type then use the copyfilters command and do the calculations u want. hope it helps Vishal NCSD

quote:


Originally posted by Uday: Hi all, In main form, when ‘code’ is selected, corresponding records are displayed in subform. Now, I want to retrieve only those records which are displayed, to add field values rather than scanning through whole table by using SETRANGE and FIND function for any ‘code’ selected. Thanks, Uday


Hi Vishal, Thanks for your suggestion. It is working now. Uday Edited by - uday on 2002 Jan 16 02:37:56

Another way is defining a new function on the subform similar to this: function getRecs (VAR variablefortherecs) BEGIN Variablefortherecs.COPY(Rec); END; that will allow you to call the function from the parent form using a variable of the same type than the subform used one and getting all the filters and the actual record they’re using on the subform. Regards, Alfonso Pertierra (Spain)apertierra@teleline.es