I'm going to do that. Somehow I thought I remembered doing this a while back in some really slick way.
>>I cannot remember how years ago I used to do the following:
>>
>>I have a cursor with X records, let's say 50. The report form needs to be 1 page exactly to fit a government mandated format. Each of those 50 items will appear somewhere on the page, depending on 3 fields contents. I cannot crosstab it.
>>
>>It is NOT a multi-band report. Each field on the report form could pull its data from anywhere within the 50 records, and there is no logical sorting that could put them in any sensible order. As each field on the report has to retrieve data, it has to check 3 fields and if matchs 3 fields write the value of a fourth field.
>
>You could use a UDF:
>
>FUNCTION MyUDF
>
>LPARAMETERS ;
> SourceColumnName ;
> , TestFieldVal1 ;
> , TestFieldVal2 ;
> , TestFieldVal3
>
>LOCAL ;
> lnSelect ;
> , luRetVal
>
>m.lnSelect = SELECT( 0 )
>
>SELECT ;
> SourceColumnName AS MyResult ;
> FROM MyCursor ;
> WHERE TestField1 = TestFieldVal1 ;
> AND TestField2 = TestFieldVal2 ;
> AND TestField3 = TestFieldVal3 ;
> INTO CURSOR Result
>
>m.luRetVal = Result.MyResult
>
>USE IN Result
>
>SELECT m.lnSelect
>
>RETURN m.luRetVal
>
>* The expression for each report field would be a MyUDF() call.
>
>* The above is fairly general. If you have only one column in your report source cursor then you wouldn't have
>* to pass the column you want to seek in. You could delete the SourceColumnName parameter
>