Results 1 to 5 of 5

Thread: [RESOLVED] Invalid Property Value Mystery

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Resolved [RESOLVED] Invalid Property Value Mystery

    In the attached relatively simple workbook, click the "Maintenance" button on the "Projects" sheet. When the userform comes up, type 1 (or any other value that doesn't exist in the list) in the Project ID combobox and click OK. When you do you will get an Invalid Propery Value error message and I can't figure out where it is coming from.
    Attached Files Attached Files

  2. #2
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Invalid Property Value Mystery

    Your selecting an item thats not in the combobox list, your property on the combobox is set not to allow this.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  3. #3

  4. #4
    Fanatic Member
    Join Date
    Feb 2013
    Posts
    985

    Re: Invalid Property Value Mystery

    In a nutshell, First change the property of the combobox to allow items not listed, change to your code, instead of running code on the _Change event use the _Keypress event and the _Exit event to handle your code, the reasons being is that your running code on every keypress which is a good way to annoy your users (obviously in your example the data is small so its not noticeable)

    on the _Keypress Event setup an 'If Enter Is Pressed' Then run the code (keycode = 13 i believe)

    On the _Exit Event run the same code for checking/Processing whats in the box

    this is generally how i handle most controls with a textbox and i never had a problem with it.

    as for adding list items, for an unsaved list of additions just check if the item is in the list (basically what you have currently in your _Change event), If its not in the list just add it using Combobox_Add Method and run whatever code you need to handle the sheet.

    If you want some examples im not busy today so ill be happy to write some examples for you on your sample.
    Yes!!!
    Working from home is so much better than working in an office...
    Nothing can beat the combined stress of getting your work done on time whilst
    1. one toddler keeps pressing your AVR's power button
    2. one baby keeps crying for milk
    3. one child keeps running in and out of the house screaming and shouting
    4. one wife keeps nagging you to stop playing on the pc and do some real work.. house chores
    5. working at 1 O'clock in the morning because nobody is awake at that time
    6. being grossly underpaid for all your hard work


  5. #5

Posting Permissions

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



Click Here to Expand Forum to Full Width