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