Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    San Clemente, California, USA
    Posts
    130
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Word Automation (2000)

    I am doing a project where I am sending data to Word via Bookmarks.

    For the price of the item:

    .ActiveDocument.Bookmarks("ATMPrice").Select
    .Selection.Text = (CStr(Forms!frmDataEntryATMPurchaseSetup!ATMPrice) )

    When I send the data to Word it is sending it as unformatted text. How can I make it show with a comma & 2 decimal places (5,583.00) as an example if the price does not have any cents. In Access the field has a data type of 'Currency'.

    Thanks!

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

    Re: Word Automation (2000)

    Try this:

    .ActiveDocument.Bookmarks("ATMPrice").Range.Text = Format(Forms!frmDataEntryATMPurchaseSetup!ATMPrice , "#,##0.00")

    Note that it is not necessary to select the bookmark. Code generally runs more efficiently if you don't select text.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Location
    San Clemente, California, USA
    Posts
    130
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Word Automation (2000)

    Hans you are the man!

    Thank you so much for all your help, it seems every time I have ever asked a question on WOPR you are right there to help me out.

    Thanks for the tip on not selecting the bookmark. I'll alter my other code for more efficiency....

Posting Permissions

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