it should work something like this:
set up two fields: one hidden that will contain the phone number
being pulled from the database - hide this field.
add a function to the default value of the other field that will be
used to display the telephone number like you want it. the function
should look something like:
concat("(", substring(field16, 1, 3), ") ", substring(field16, 4, 3),
"-", substring(field16, 7, 10))
(field16 is the hidden field)
this might not fit exactly your circumstance, but it should point you
in the right direction...
this article is related to what you want to do.
read this article....
http://enterprise-solutions.swits.net/infopath/auto-format-time-on-lostfocus.htm
steve lescure