Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    I'm wondering if there is a way to use the same form for multiple purposes. It's a loan form and a lot of the form fields are the same, but depending on the type of loan, some areas can be left blank, while others become mandatory. Is it possible to have a user select a radio option for the type of loan at the beginning of the form, and then have the form only allow access to the fields needed for that type of loan?

    Thanks in advance for any suggestions!
    egghead

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    That wouldn't be easy. It would require VBA, and in that case you might as well use a userform created in the Visual Basic Editor. Userform controls have Visible and Enabled properties that let you hide or disable them if needed. Of course, you'd also need code to populate the document with the values entered in the userform.

    In the end it might be easier to create separate documents...

  3. #3
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='775024' date='12-May-2009 20:52']That wouldn't be easy. It would require VBA, and in that case you might as well use a userform created in the Visual Basic Editor. Userform controls have Visible and Enabled properties that let you hide or disable them if needed. Of course, you'd also need code to populate the document with the values entered in the userform.

    In the end it might be easier to create separate documents...[/quote]

    There's not an easy way to have multiple user forms either, correct? Most of what I've read on userforms seem to assume the use of just one userform.

    My thought would be to have multiple templates and set up a template folder so that all of the loan forms are in one folder, separate from any other templates.

    Thank you for the help!
    egghead

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can create several userforms, and use one of them to let the user select a type of loan, then open the appropriate userform. But it'll still be a lot of work. A folder with loan form templates should work nicely.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I have done forms like this by bookmarking regions of the form and using a little bit of VBA to hide/unhide regions based on decisions made by the user. This will not physically remove the hidden sections from the document, it just hides them from view.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    One other alternative to a set of separate templates, would be to fold all of the different forms into a single template, by saving each of them as autotexts. The initial userform would only need to present the option as to which loan form the user wants to select; once they select an option, the appropriate autotext gets inserted as the document content.

    It's a little more work to set up and maintain (as opposed to having individual templates), but it does offer the benefit of allowing the user to access all the different types of loan forms, via one template.

  7. #7
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The autotext option is interesting! How is the userform set up to pull autotext?

    Your comment about maintaining is a good one to think about, too, as the forms are currently in Word 2003. It's not fun to contemplate moving to Office 2007 (or 2010) when designing forms, since forms are so different in Office 2007.
    egghead

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    It's true that Word 2007 introduces the new Content Controls, but the old 'legacy' formfields are still available and a Word 2003 template with them should still work when brought to 2007.

    How to have the userform pull up autotext:

    Let's say you have two different protected forms, that you want to make available within one template.
    For each of the protected forms, you could create it in the template document, and then save it as an autotext, saved to the template (let's say they're called Form1 and Form2).

    You could leave the actual template document empty by default. Whenever you want to do development or maintenance work on either of the forms, just insert it (from autotext) into the template, work on it, then re-save it as autotext, and delete it from the template body so the template remains empty.

    As for the userform, let's say you have two option buttons named opt1 and opt2. Behind the userform, you could use code like this:
    Code:
       If opt1.Value = True Then
    	  ActiveDocument.AttachedTemplate.AutoTextEntries("Form1").Insert _
    		 Where:=Selection.Range, RichText:=True
       ElseIf opt2.Value = True Then
    	  ActiveDocument.AttachedTemplate.AutoTextEntries("Form2").Insert _
    		 Where:=Selection.Range, RichText:=True
       End If
    - and the appropriate form content would get inserted into the document.

Posting Permissions

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