Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting output to word (A2k)

    I'm probably doing this wrong, but it seems like Access isn't listening. Here's my code:

    .ActiveDocument.Bookmarks("SSN").Select
    .Selection.Text = Right(Format((CStr(Forms!frmStudents!SSN)), "@@@ @@ @@@@"), 11)

    Here's the result:

    @@ @@ @@@@@

    Any suggestions?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting output to word (A2k)

    I figured it out. I'm guessing Access goes in order from right to left, so my information is being formatted first, then trimmed. If I add a @ to the beginning of my format (now looking like this: @@@@ @@ @@@@) it works.
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

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

    Re: Formatting output to word (A2k)

    Perhaps the SSN field contains @@@@@@@@@? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Added: by default, strings are formatted right to left. You can use ! in the format to specify that formatting should proceed from left to right.

Posting Permissions

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