Hopefully Easy Formatting Question

  • I'm creating my 1st (!) VB app connecting to my 1st sql database so I'm very new to all of this. I have a phone number field in the database consisting of 10 characters (area code and number) I need the number formatted as a phone number (000)000-0000 but I'm having trouble getting it to work. Should I format it on the sql view or should I format it through the VB app? Right now, this is what I have:

    Me.txtWorkPhone.Text = .Fields(Format(("WORKPHONE_TXT"), "(999)000-0000")).Value

    This will not format the number. Any suggestions? If I need to define the format on the server side can someone point me in the right direction as to how to do this?

    Thanks for any help!

    Judy

  • Generally you do formatting on the client, sometimes it makes sense to do in a view so you just code it once. Try this:

    format$(.Fields("WORKPHONE_TXT"), "(999)000-0000").Value)

    Andy

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply