Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Format data (xp)

    Am exporting data from Access to Access and Excel via VB6. One of the fields that I am exporting holds phone numbers. When the numbers are used in my app they are formatted (xxx) xxx-xxxx. They show up the same way in Access database. However, when exported to either Access or Excel and then used in a merge doc in Word, they are unformatted, xxxxxxxxxx.

    Is it possible to have the data formatted so that there is no formatting necessary in Word?

    Thanx.

    Kim
    Thanks

    Kim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format data (xp)

    One possibility is to add a number format switch to the merge field in the Word document: with field codes displayed, it would look like

    { MERGEFIELD Phone # "(000) 000-0000" }

    Another possibility is to create a query in Access that includes a calculated column that displays the formatted phone number:

    Phone: Format(tblSomething.Phone, "(000) 000-0000")

    (substitute the appropriate table and field names)

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    160
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Format data (xp)

    Hans,

    Right on target. Many thanks for your help.

    Kim
    Thanks

    Kim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •