none
allow only values from list of values in field RRS feed

  • Question

  • I've got a custom Task form with a user defined field that I present to users as a combo box. There are 10 choices in the dropdown list. I want to force users to either leave the field blank, or pick one of the items from the dropdown list. I don't want them to be able to type something else in the field.

    I'm used to working in Access and this is a simple option from Access in combo boxes. Is there a way to implement this in an Outlook 2007 form?


    Gordon Prince * (901) 761-3393

    Thursday, February 9, 2012 11:37 AM

Answers

  • There's a property that can be set for list/combo controls called MatchEntry that should do that for you if set to -1. See http://www.outlookcode.com/article.aspx?id=32 for information on using controls in custom Outlook forms.
     
    If you're not used to custom Outlook forms the forms information starting at http://www.outlookcode.com/article.aspx?ID=35 and in the other forms tabs might also be helpful to you.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Gordon Prince" <=?utf-8?B?R29yZG9uIFByaW5jZQ==?=> wrote in message news:df93d285-6a88-4732-879b-be02f394b030...

    I've got a custom Task form with a user defined field that I present to users as a combo box. There are 10 choices in the dropdown list. I want to force users to either leave the field blank, or pick one of the items from the dropdown list. I don't want them to be able to type something else in the field.

    I'm used to working in Access and this is a simple option from Access in combo boxes. Is there a way to implement this in an Outlook 2007 form?


    Gordon Prince * (901) 761-3393


    Ken Slovak MVP - Outlook
    • Marked as answer by Gordon Prince Monday, February 13, 2012 8:14 PM
    Thursday, February 9, 2012 2:51 PM
    Moderator

All replies

  • There's a property that can be set for list/combo controls called MatchEntry that should do that for you if set to -1. See http://www.outlookcode.com/article.aspx?id=32 for information on using controls in custom Outlook forms.
     
    If you're not used to custom Outlook forms the forms information starting at http://www.outlookcode.com/article.aspx?ID=35 and in the other forms tabs might also be helpful to you.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Gordon Prince" <=?utf-8?B?R29yZG9uIFByaW5jZQ==?=> wrote in message news:df93d285-6a88-4732-879b-be02f394b030...

    I've got a custom Task form with a user defined field that I present to users as a combo box. There are 10 choices in the dropdown list. I want to force users to either leave the field blank, or pick one of the items from the dropdown list. I don't want them to be able to type something else in the field.

    I'm used to working in Access and this is a simple option from Access in combo boxes. Is there a way to implement this in an Outlook 2007 form?


    Gordon Prince * (901) 761-3393


    Ken Slovak MVP - Outlook
    • Marked as answer by Gordon Prince Monday, February 13, 2012 8:14 PM
    Thursday, February 9, 2012 2:51 PM
    Moderator
  • The "MatchEntry" property does it. Thanks.

    What would you recommend to allow null values? The item will save with null values in the fields with the combo boxes. But if my cursor enters a field with a combo box that has MatchEntry set, I can't get out of the field without picking one of the entries. Sometimes I don't know the value, so null is the right answer.

    How have you handled this?


    Gordon Prince * (901) 761-3393

    Saturday, February 11, 2012 2:45 PM
  • Hi Gordon,

    Thanks for posting in the MSDN Forum.

    As far as I know that null values aren't allowed to add into the combobox's items collection. So your problem will not exist.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 13, 2012 2:32 AM
    Moderator
  • Here's what I see:

    Enter a combobox field that has no value in the field, don't type or choose anything -- can leave the field.

    Enter the combobox field, choose a value, decide to clear the field to put it back to being blank -- can't leave the field. When I try to leave the field I get a pop-up message "Invalid Property Value". The only way I see to get out of the field is to Save & Close the item, then reopen it. I'm wondering if there's something simpler to tell users than "Save & Close, then reopen".


    Gordon Prince * (901) 761-3393

    Monday, February 13, 2012 1:41 PM
  • I haven't handled it from a list.
     
    In cases like that I'd have a NA value or I wouldn't use MatchEntry.
     
    I'd use another method and validate the entry with the business logic for the control with code and use the code to decide whether to accept or invalidate an entry.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Gordon Prince" <=?utf-8?B?R29yZG9uIFByaW5jZQ==?=> wrote in message news:8df42f9b-e437-49c9-b93f-7dfdf33ca1d6...

    The "MatchEntry" property does it. Thanks.

    What would you recommend to allow null values? The item will save with null values in the fields with the combo boxes. But if my cursor enters a field with a combo box that has MatchEntry set, I can't get out of the field without picking one of the entries. Sometimes I don't know the value, so null is the right answer.

    How have you handled this?


    Gordon Prince * (901) 761-3393


    Ken Slovak MVP - Outlook
    Monday, February 13, 2012 7:26 PM
    Moderator