Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jun 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validation on a Created Form (2000)

    Is there a way for me to create a form in MSWord (or any other MS software) and have it modify itself based on user responses? On the form that I have attached, there is a box called, "Contract Type" for which I have created a drop down menu. For certain selections in the drop down, I will need additional information. For example, if the users pick "CDA" from the dropdown, I want another box to appear, within the form, that asks for a "Project Management Contact Person". However, if the user picks "Letter of Intent", I won't need the additional information and therefore, the Project Management Contact Person box remains hidden.

    Your suggestions are greatly appreciated!
    Attached Files Attached Files

  2. #2
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation on a Created Form (2000)

    This is really no problem. The easiest way is to hide the variant stuff, overlapping in the same area, perhaps. When the listbox or combobox changes (lbWhatever_Change event), check the new value, and toggle the .visible property of the other fields.

    In situations like this, I usually test *all* the variable items when anything changes, e.g.

    strX = lbWhatever.Text
    cbSomething.Visible = (strX="Check")
    cbOther.Visible = (strX="Money Order")
    cbElse.Visible = (strX="Visa" or strX="MasterCard")

  3. #3
    New Lounger
    Join Date
    Jun 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation on a Created Form (2000)

    Hi Joel! Thank you som uch for the info....although you've kind of lost me. Can you show me how to do this in "Word for Dummies" terms? If you can post an example, that would be very helpful also.

    Thanks alot!!!!

  4. #4
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation on a Created Form (2000)

    1) Create a new UserForm
    2) Add a ComboBox, (ComboBox1)
    3) In the properties, change the "Style" to "2- frmStyleDropDownList"
    4) Add three check boxes (CheckBox1, CheckBox2, CheckBox3)
    5) Double-click on the combo box and enter the following text before "End Sub"

    dim strChoice as string
    strChoice = ComboBox1.Text
    CheckBox1.Visible = (strChoice = "One")
    CheckBox2.Visible = (strChoice = "Two")
    CheckBox3.Visible = (strChoice = "Three")


    4) Below the End Sub, type the following

    Private Sub UserForm_Initialize()
    ComboBox1.AddItem "Zero"
    ComboBox1.AddItem "One"
    ComboBox1.AddItem "Two"
    ComboBox2.AddItem "Three"
    CheckBox1.Visible = false
    CheckBox2.Visible = false
    CheckBox3.Visible = false
    end sub

    5) That's it! Press the Run button, and test it out. There's no OK or Cancel, but you can close the window when you're done.

  5. #5
    Star Lounger
    Join Date
    Jun 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validation on a Created Form (2000)

    Just to add a thought to this post,

    In "Word for Dummies" terms, this is nice and 'elegant', but maybe a bit short on explaination.

    the line CheckBox1.Visible = (strChoice = "One") means
    that IF the user selects the word "One" then (strChoice = "One") is TRUE
    if the user chooses anything else then (strChoice = "One") is FALSE

    CheckBox1.Visible decides whether you can see the CheckBox (TRUE) or not (FALSE)

Posting Permissions

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