REPORT FORM MyReport PREVIEW FUNCTION MyUDF *Do Something RETURN MyValueYou can also use a method instead of a UDF. For example, if you have an application object, such as oApp, you can create a method right in the object and then call that from the expression of a Field object, from the On Entry and On Exit expression and even in the Report Variable expressions, as follows:
oApp.MyNewMethod()The bottom line is that you call it like any other UDF or method so you just have to be sure that's it's available just before you run the report.