Another method, if all of tables are related, is to do a single query to get your selection set, relate that to each of the tables, then, in the report ytou can reference then in "." notation -- You can include functions with the data (even udfs -- if you rememeber to add the "set procedure to" stratement in the init code of the data environment)
- with this method, you don't put any data actually in the data environment, and you can easliy change your selection set by just altering your looping query!
-- if not all of the tables are related, you can use udf's to locate specific info -- just remember to a) start your udf with saving your old work area, b)checking for new work area c) closing the new work area if necessary and d) -- ost reimportant restoring the work area
As always in VFP, there's more than one way to accomplish a job!
Here's a sample udf:
*************************
FUNCTION FindArea
*************************
LPARA pstrArea
intHoldArea = select()
* if table not open, open it in new work area
IF !used('AreaTable')
USE AreaTable order AreaKey in 0
ENDIF
retValue = ''
IF seek(allt(pstrArea),'AreaTable')
retValue = allt(AreaTable.AreaName)
ENDIF
SELE (intHoldArea)
RETURN retValue