>Ok, but the UDF would still be a series of CASE statements to return the correctly formatted field value, right?
Probably. One level of DO CASE for each type of field, a second level for each format defined for that type of field.
Unless you decide to use a data-driven approach: Instead of the CASEs, put the different options into a table, and your function just looks it up. That may save you re-compiling when you add a CASE. Actually, since you have some complicated formatting, in this case you probably would have to store the entire expression in a memo field, e.g. (for a date), something like this:
trans(year(txValue)) + "-" + padl(month(txValue), 2, "0") + "-" + padl(day(txValue), 2, "0"). I did something similar for data validation, and it works quite well.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)