Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASK fields - making them optional (Word 2002)

    <P ID="edit" class=small>(Edited by jscher2000 on 23-Mar-03 19:08. Subject changed to indicate the reason you need help.)</P>I have created a document that prompts users to enter info based on the required prompts. I used the ASK filed, bookmark name and then cross-referenced the fields as required. I then created an AutoOpen macro.

    Now when this form is opened the user is automatically prompted to enter the required info. The problem is that if a user leaves a prompt blank it comes up with an error. The problem is that I have 8 lines of headings that is required but if only 5 lines are used then the user leave 6-8 blank but it gives you an error in each of these lines. I want Word to just leave 6-8 blank. Does anyone know how I can get around this?

    Also, on another page I have a cross reference to these Headings and underneath the headings I have standard text that is required. I need to know what can I do if a user only enters 5 headings out of eight and have Word automatically delete the rest of the standard text in the document.

    I hope you can understand what I want to do. Appreciate anyone

  2. #2
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    There is a MS knowledge base article on this with a work around. 212125

    Alternatively you could enclose the ASK questions in an IF field, thus limiting the number ASKs to the desired number of headings. If it were pracical you could ask the user how many headings they were adding, and thus limit the number of ASK questions based upon their response.

    Regards,

    Matthew

  3. #3
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    Thanks for your tip, the MS knowledge base article was useful, I now know its isn't me but Microsoft. I can't limit the number of ASKs as it changes for different users.

  4. #4
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    What about ASKing the user how many headings they are going to add. eg 5. {ASK NumHeadings "Enter the number of headings" }

    Then enclose each ASK field inside an IF field. eg {IF NumHeading > 1 "{ASK Heading2 "Enter description of Heading 2"} " ""}. You would repeat this for each ASK field, 8 in your example.

    This reduces the number of questions a user is asked which is nice from their perspective and reduces the chances of the user doing something unexpected. The downside is that the user has to be able to count the number of headings they wish to add. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

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

    Re: ASK fields - making them optional (Word 2002)

    Hi lisbry,

    To make the fields optional, try setting up each ASK field with a companion SET field like:
    {SET Answer1 " "}{ASK Answer1 Question1 d " "}
    What this does is to pre-define the Answer1 bookmark as a space character and to set the default ASK response to a space character also. You'll still get all the ASKs, but pressing the Cancel button won't produce an error in subsequent references to the Answer1 bookmark.

    Then, wherever you need to use the response, you can eliminate the superfluous space characters in 'empty' responses by usin an IF test inside a QUOTE field:
    {QUOTE{IF{Answer1}= " " "" {Answer1}}}
    or, if you need to insert something different based on whether Answer1 has an entry,
    {QUOTE{IF{Answer1}= " " "" "Your text goes here."}}

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    I was thinking along the lines of using an IF field, but I see that macropod has proposed such a solution, far more elegant than I'd have dreamt up no doubt. But with regards to the inclusion/exclusion of text blocks on the other page, would it be possible to again use IF fields to insert (or not) these blocks of "standard text"? These blocks could be stored as AutoText entries, and this approach might be easier than trying to delete existing slabs of the document. I hope I've understood your question properly here.

    Alan

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

    Re: ASK fields - making them optional (Word 2002)

    Hi Alan,

    I've been thinking a bit more about this issue, and realised that I could simplify things a bit. To make the fields optional, lisbry could set up each ASK field and its companion SET field like:
    {SET Answer1 ""}{ASK Answer1 Question1}
    This does away with the need for the default space, so that it doesn't have to be tested later. This uses SET to create an empty bookmark - you could also do the same without using SET, via Insert|Bookmark.

    Then, wherever you need to use the response, you'd simply use:
    {Answer1}
    If Answer1 is empty, then this field would be empty also.

    As for the issue of adding/deleting text based on whether Answer1 is empty, that's as easy as:
    {QUOTE{IF{Answer1}= "" "Text if empty goes here" "Text if not empty goes here"}}

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. #8
    Star Lounger
    Join Date
    May 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    Hi Macropod,

    I've seen you use Quote fields in many of your solutions. In some of them like the date calculator it is obviously needed, but others like your solution to this problem I don't understand how it is used. Could I trouble you for a bit of lesson in the implementation of the Quote field.

    Thanks

    Matthew

  9. #9
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    THANK YOU all for your tips. I have thought of using the AutoText but I need to keep this as simple as I can for all users. Macropod your suggestion seems to be what I want to be able to do, but unfortunately I don

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

    Re: ASK fields - making them optional (Word 2002)

    Hi Mike,

    The QUOTE field is used for inserting text strings into a document. Usually you'd only use it to insert text that is the result of a formula. In this case it's not strictly necessary - one could get away with just the IF test - but I tend to use it for consistency, thus avoiding problems with formulae that might not give the required result without it.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

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

    Re: ASK fields - making them optional (Word 2002)

    Hi lisbry,

    The SET field is used here to create a bookmark. In the example I gave you, it's named 'Answer1'. The ASK field is also used to create/update the same bookmark. The problem you've been having is caused by ASK's failure to create the bookmark if the user doesn't enter anything. By creating the bookmark before doing anything with it with ASK, the bookmark exists whether or not the user enters anything in response to the ASK prompt. If you're using multiple ASK statements, you should ensure that the corresponding bookmark is created for each of them before the ASK statement is invoked.

    As mentioned previously, you could create the bookmarks via Insert|Bookmark too. I used SET so that it would be 'easier' for anyone updating the template to understand how it works. Without the SET fields, the significance of creating the bookmarks in advance of the ASK statements might be missed.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  12. #12
    Star Lounger
    Join Date
    Jul 2002
    Location
    melbourne, Victoria, Australia
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    Hi macropod, I fell like a real dil, I think I am getting closer but it still doesn't work. I must be still doing something wrong. I get the prompts but it doesn't enter any of my info I type, it just leaves it blank. Can you tell me where I can get instructions for doing this, as I am really tearing my hair out as I have spent hours on this. I appreciate your reply. Thanks.

  13. #13
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASK fields - making them optional (Word 2002)

    Looks like a very neat solution macropod. I've never used the QUOTE field before, but it's one I'll try to burn into the cranial ROM. The only limitation I can see off the cuff, is if the required text blocks are formatted, rather than boilerplate - this is where AutoText might be appropriate I guess.

    Alan

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

    Re: ASK fields - making them optional (Word 2002)

    Hi lisbry

    Before you can see any of the typed answers to the ASK prompt, you need to insert a reference field wherever you want to see it. So, if you're using something along the lines of:
    {ASK Answer1 "This is the question"}
    you need to have another field like:
    {Answer1}
    in your document before you can see the result.

    If you want to see the response where the ASK field is placed, use something like this:
    {Set Answer1 ""}{QUOTE{ASK Answer1 "This is the question"}{Answer1}}
    Using the QUOTE field this way forces the {Answer1} field to update and display its results immediately the OK or Cancel response is input into the ASK field. As before, the preceding SET field ensures the 'Answer1' bookmark gets created regardless of what is entered into the ASK field.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

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

    Re: ASK fields - making them optional (Word 2002)

    Hi Mike,

    If you read my latest post to lisbry, you'll see another use for the QUOTE field - to force the immediate display of the response given in an ASK field. Unlike FILLIN fields, which automatically display their results, ASK fields update a bookmark instead. You then need to use a reference field to get the results of an ASK field to display, and embedding both the ASK field and the reference field within a QUOTE field achieves this.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Page 1 of 2 12 LastLast

Posting Permissions

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