Display phone numbers

graydon321
01-13-2004, 03:51 PM
Hello,

Very new at VB.net (and programming), I used the data form wizard to create a form that would display data from one table. The fields populate fine, including the phone number field. However, the phonenumber field ("Customer.Phone" is the table.column name) displays in its raw format ei: 5555555555. I would like it to display (555)555-5555.
I added the maskedbox control to my toolbar and then dragged it to my form (named it medCuPhone). Then I went to medCuPhone properties and under databindings.text I changed the settings to dsCustomer-Customer.Phone. Now none of the text boxes populate including the mask edit box.

If I set the databindings.text property back to none, the data will once again populate correctly...except for medCuPhone.

Could somebody please help me out and tell me what I am doing wrong?
I appreciate the help!

Gray

Optikal
01-13-2004, 03:58 PM
I don't use databinding, so I can't tell you how to do it the databinding way (databinding in VB6 is generally considered bad, and not used).

But if you use raw ADO code (..) you can just do something like:

MyTextBox.Text = Format$(MyRecSet.Fields("phone_number"), "(###) ###-####")

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum