Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF field using ASK field user input (Word 97/2000/XP)

    I wish to automate a letter using ASK, IF and INCLUDETEXT fields. The letter is generated as part of a mail merge from another application, so I assume macros are out of the question. (my macro skills are limited anyhow)

    What I am attempting to do is the following:

    The letter will insert a paragraph for each client based upon user input into an ASK field. I
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: IF field using ASK field user input (Word 97/2000/XP)

    This sounds like the classic case where Word Mail Merge runs out of steam because it expects to basically see one "record" for each document. I suspect you would be better off to take a hard look at OLE Automation and see if you can't build the document on the fly and not require the user to provide information. This knowledge base article may be enough to get you started, but you would want to look at some of the other Automation articles on the MS site, and you might also want to look at a book or two - The Access Developers Handbook is an excellent choice in my opinion.
    Wendell

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: IF field using ASK field user input (Word 97/2000/XP)

    Hi Matthew,

    Perhaps what you need to do is to first ask the user how many clients there are:
    {ASK ClientNos * Upper "How many clients (1-10) are there? " d ""}

    Having obtained that information, you can then wrap an IF test around each of the subsquent ASK statements:
    {IF ClientNos < 1 "" {ASK Taxpayer1 ....}}
    {IF ClientNos < 2 "" {ASK Taxpayer2 ....}}
    {IF ClientNos < 3 "" {ASK Taxpayer3 ....}}
    {IF ClientNos < 4 "" {ASK Taxpayer4 ....}}
    and so on.

    That way, when the 'update fields' process is run, the user will only be asked to fill in the details if the current record is equal to or less than the number of clients.

    One other comment - your IF statements are in the form of:
    IF type1 INCLUDETEXT type1 document, false do nothing
    IF type2 INCLUDETEXT type2 document, false do nothing
    IF type3 INCLUDETEXT type3 document, false do nothing
    You could instead use:
    IF type1 INCLUDETEXT type1 document, IF type2 INCLUDETEXT type2 document, IF type3 INCLUDETEXT type3 document, ... etc... , false do nothing

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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