Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Sacramento, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd.SendObject Text formatting (Access XP, Windows XP SP2)

    I have a test database set up to to a SendObject for each record of a recordset, with the text of the message body filled in with data from the recordset. Everything works fine, except that Currency Fields don't pass through with original formatting, and resist any attempts to format. The closest I can get is by using the "Format" function, but the 0's for amounts less than 1,000 show up like this: $65.33 shows as $0,065.33. I've tried different formatting options, and the original table uses "Currency" datatypes and formats for all number fields.

    Any ideas? I've attached the test DB ...thanks!

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: DoCmd.SendObject Text formatting (Access XP, Windows XP SP2)

    Change the format commands in the SendObject from $0,000.00 to $#,##0.00

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Sacramento, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd.SendObject Text formatting (Access XP, Windows XP SP2)

    Thanks Patt, that worked well; is there a way to right justify them so they line up more like Currency? Thanks in advance.

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

    Re: DoCmd.SendObject Text formatting (Access XP, Windows XP SP2)

    Use "#,##0.00" as format string instead of "0,000.00". A # means that the position is optional. If you want to right-align the amounts, use

    "... Total :" & Space$(22 - Len(Format(TOT, "$#,##0.00"))) & Format(TOT, "$#,##0.00") & vbCrLf & _

    and similar for the other fields. Note that I used vbCrLf instead of Chr(13) + Chr(10) - less typing.

  5. #5
    Lounger
    Join Date
    Jan 2001
    Location
    Sacramento, California, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd.SendObject Text formatting (Access XP, Windows XP SP2)

    Thanks Hans; you have once again amazed me with your straight forward and accurate assessment and answer.

    Thanks again to you too Patt, and to all of you who make us look good with your toil!

Posting Permissions

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