>thankd david
>but i am not using dbc. I want use index in dbf.
Why are you not using a DBC? It offers you several advantages: long field names; triggers; referential integrity; comments for fields; and others.
In this case, if you don't use a DBC, you can still use your function - you just have to make sure it is always available.
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)