none
Custom Form based on Multiple-Selection by user. + date/user stamped text editing. RRS feed

  • Question

  • I have multiple separate forms that I want to consolidate into one form. I've seen questions like this however, I want the user to be able to select multiple items and thus have one sheet with two forms on it. (I cant find an answer to this already).

    Assuming forms a, b, and c. Each with items a1, a2 | b1, b2 | c1, c2. I want the user to be able to select one or multiple forms, and have the respective fields filter accordingly below. For example:

    Scenario 1

    multiple Dropdown: User selects only form A

    a1 visible

    a2 visible

    (b1,b2,c1, and c2 not visible)

    Scenario 2 multiple Dropdown: User selects both A and C

    a1 visible

    a2

    c1

    c2

    (b1 and b2 not visible)

    Background: We are utilizing multiple appliances for reporting security incidents in an IT environment, and have different forms for each appliance. I want to consolidate to one incident form that's dynamic based on each appliance that's being used to correlate evidence.

    Additional Notes: I'm also looking to add a comprehensive comment box at the bottom of the form. If possible I'd like the box to be a record of what's been done by the IT members. Ideally, each time a member adds to the box, his comments would be stamped with time and username, and become locked. Other members adding to the field after would be unable to change previous text, and also get username/time stamped to their input. I've found discussions on the use of comments and change tracking, but they don't seem to meet the task.

    Any help is much appreciated!

    • Edited by Willovv Wednesday, June 24, 2015 2:27 PM
    Wednesday, June 24, 2015 2:24 PM

Answers

  • Hi Willow

    Ah... I did propose a dialog box - that's a slightly different kettle of fish than what you'll find on the Developer tab :-)

    ***[Inserting new thought!!]As I wrote what follows, I realized there could be a simpler (non-code) way for you to let the user choose the entries (a,b,c). Are you familiar with Building Blocks (AutoText)? There is a content control type for inserting Building Blocks that provides a dropdown. You could create Building Block entries for the three types and have three content controls. Or you could create Building Blocks for each of the possible combination, with one content control. I'm throwing this in here, but continuing below with the way we discussed up to now. You'll still need the dialog box for the protected information.***

    Here are some tutorials about creating UserForms (dialog boxes) for Word templates. They present a lot of stuff you don't need for this particular project, but the do give you a good overview about the tool and what kinds of things you can put in the UserForms.

    http://www.fontstuff.com/vba/vbatut09b.htm
    http://www.gmayor.com/Userform.htm
    http://gregmaxey.mvps.org/word_tip_pages/create_employ_userForm.html

    Create a template (*.dotm) file as the basic form for the documents. It will also serve as a container for the code and the Building Block entries for the three different sections you want to provide.

    Dialog box (UserForm): You'll want at the minimum three checkboxes, a textbox, a button for "OK" and probably a button for "Cancel". You can also use Labels in order to provide instructions. At the moment, don't worry about any code.

    To start, create the template with all the text you want on the form (including all three options). For the notes to be protected, insert a Content Control from the Developer tab, plain text type is probably OK for your purpose. Set the control's properties, especially, give it a name. You'll want to activate the first three of the four checkboxes, but not the last.

    Are you familiar with Building Blocks (used to be called AutoText)? Basically, you create the text you want to be able to insert, then select it, go to Insert/Text/QuickParts/Save selection to Quick Part Gallery. In the dialog box, give it a meaningful name, assign it to a category (you can create your own) and a gallery. VERY IMPORTANT: from "Save in" choose the template - do NOT use the default. If you do, the text won't travel with the template... Also, you probably want to insert the content in its own paragraph.

    At this point, you should have:
    -  a (non-working) UserForm to capture information
    - Three Building Block entries
    - The template with all the text

    Once you have the building block entries you can delete that text from the document. Then create Bookmark where the code should insert the Building Blocks. (Or, if you like the Building Block content control approach, just insert the content control.)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by L.HlModerator Friday, July 10, 2015 9:17 AM
    Friday, June 26, 2015 7:10 PM
    Moderator

All replies

  • Hi Willow

    we really need to know which technology you're using for the form(s)? Is this VBA? Or a .NET language? Something else?

    Is your question even related at all to Microsoft Word, the topic of this forum?


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, June 24, 2015 2:59 PM
    Moderator
  • Currently the existing forms are generic MS Word (2010) forms that are being printed and filled out by hand.

    I want to create dynamic forms which can be filled out as an investigation occurs, and printed or archived after.

    Wednesday, June 24, 2015 3:32 PM
  • Hi Willow

    Thanks for the clarification :-)

    Given the requirement: "Additional Notes: I'm also looking to add a comprehensive comment box at the bottom of the form..."

    Would you consider using a "dialog box" type of UI for choosing the sections and for adding the comments? I think that will be the only way to fulfill the requirement of "locking".

    Also, are you open to using Content Controls (at least for the Comments) as opposed to the legacy form field controls?

    Follow-up question: Are you going to be wanting to extract the data from these forms for further use/database?


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, June 24, 2015 5:18 PM
    Moderator
  • I'm open to which ever method best suites the needs. I'm no MS guru.

    I simply need a way for technician A to make notes about what has been reviewed or completed and annotate it at the bottom of the form (preferably with automatic timestamp and if possible username) then have that entry locked so that if technician B comes in later to add additional notes he cant change what technician A has reported.

    The "comments" box does not need to be tied to the dynamic portions of the document in any way.

    I do not need the forms to be linked to anything or have any of their data extracted. They will simply serve as a written record of investigations and appliance tuning. We will be filing them based on date. The appliances we use will give us the search functions we need to isolate which forms we need to pull for any given incident.

    

    Wednesday, June 24, 2015 10:51 PM
  • Hi Willow

    OK, so would something like this meet your needs:

    1a) The user selects your template to create a new document OR
    1b) The user opens an existing document

          - a dialog box appears, triggered by creating/opening the document

    2a) For the new document, the three options are listed, as checkboxes (that's the usual way to request multiple selections and will save time as the user won't need to click to display a list). There's also a text box to type notes.
    2b) Only the text box to type notes is offered.

    3a) Confirming the dialog box will insert the appropriate sections. (It's safer to save each section as a Building Block in the template and insert what's required. That way, nothing hidden can appear accidentally.) The notes are written to a PROTECTED content control.
    3b)  The notes are written to a PROTECTED content control.

    4) The user can then edit the form information of the inserted sections, save, close, etc.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, June 25, 2015 3:33 PM
    Moderator
  • That looks pretty solid.

    1b) The user will need to see information that was completed initially when the document was created. ie 2b) 2A boxes would be present, and all resulting sections + text box to append new notes.

    Thursday, June 25, 2015 5:08 PM
  • The document would be visible "behind" the dialog box, so the user could view anything he needs to see by moving the dialog box. It would also be possible to add a button to the Ribbon to display the dialog box by choice, rather than having it display automatically when an existing document is opened. That will keep the code simpler.

    And please note: I'm not going to give you a finished solution - I get paid for that kind of work. All we do here in the forum is show you how to do it, yourself...


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 26, 2015 3:55 PM
    Moderator
  • Give a man a fish, feed him for day...

    Teach a man to fish... and he'll build useful forms in MS word!

    Friday, June 26, 2015 4:29 PM
  • <G> So where does that leave us? Good to go, as described?

    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 26, 2015 4:46 PM
    Moderator
  • Ok, so starting at the top: To add the multiple selection (check boxes) i'm utilizing a check box content control found under the developer tab.

    What I don't understand is how to make content linked to the boxes and force it to be visible only when the box is checked.

    Friday, June 26, 2015 6:10 PM
  • Hi Willow

    Ah... I did propose a dialog box - that's a slightly different kettle of fish than what you'll find on the Developer tab :-)

    ***[Inserting new thought!!]As I wrote what follows, I realized there could be a simpler (non-code) way for you to let the user choose the entries (a,b,c). Are you familiar with Building Blocks (AutoText)? There is a content control type for inserting Building Blocks that provides a dropdown. You could create Building Block entries for the three types and have three content controls. Or you could create Building Blocks for each of the possible combination, with one content control. I'm throwing this in here, but continuing below with the way we discussed up to now. You'll still need the dialog box for the protected information.***

    Here are some tutorials about creating UserForms (dialog boxes) for Word templates. They present a lot of stuff you don't need for this particular project, but the do give you a good overview about the tool and what kinds of things you can put in the UserForms.

    http://www.fontstuff.com/vba/vbatut09b.htm
    http://www.gmayor.com/Userform.htm
    http://gregmaxey.mvps.org/word_tip_pages/create_employ_userForm.html

    Create a template (*.dotm) file as the basic form for the documents. It will also serve as a container for the code and the Building Block entries for the three different sections you want to provide.

    Dialog box (UserForm): You'll want at the minimum three checkboxes, a textbox, a button for "OK" and probably a button for "Cancel". You can also use Labels in order to provide instructions. At the moment, don't worry about any code.

    To start, create the template with all the text you want on the form (including all three options). For the notes to be protected, insert a Content Control from the Developer tab, plain text type is probably OK for your purpose. Set the control's properties, especially, give it a name. You'll want to activate the first three of the four checkboxes, but not the last.

    Are you familiar with Building Blocks (used to be called AutoText)? Basically, you create the text you want to be able to insert, then select it, go to Insert/Text/QuickParts/Save selection to Quick Part Gallery. In the dialog box, give it a meaningful name, assign it to a category (you can create your own) and a gallery. VERY IMPORTANT: from "Save in" choose the template - do NOT use the default. If you do, the text won't travel with the template... Also, you probably want to insert the content in its own paragraph.

    At this point, you should have:
    -  a (non-working) UserForm to capture information
    - Three Building Block entries
    - The template with all the text

    Once you have the building block entries you can delete that text from the document. Then create Bookmark where the code should insert the Building Blocks. (Or, if you like the Building Block content control approach, just insert the content control.)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by L.HlModerator Friday, July 10, 2015 9:17 AM
    Friday, June 26, 2015 7:10 PM
    Moderator