I have a drop down list that gets populated as the user enters information earlier in the form. I need to make sure that the drop-down list does not allow the user to select the same value more than once....I'm stuck and not sure how to even begin doing this. Anyone able to help?
Here's my solution for that. I'm not certain how you're doing it, but in my example, I wrapped the buttons and dropdown list for each instance in a subform. I maxed it out at 4 since I only included that many items in the drop down list.
Thanks so much for the reply! I've actually got a drop down list that the user will be adding an instance of for each different value with a + button: + - Resource Name:_________________ <--- that's the drop down. If the user hits + it adds another instance, if he hits - it takes away that instance... So if I've got to make sure that the Resource Name is different for each instance how would I go about that?
Easiest way is to blank out one or the other once the user has selected the option in a dropdown list. (You could pop a message box and set the focus back to the same list to help the user understand what is going on.)
Alternatively, you could remove the option from the list entirely before the user selects the item in the "enter" event. However, there's a lot of logical issues here since you said the list is populated as the user enters information. For an easy example like mine (where the list is populated in advance by A, B, C, and D) it's simple to just set the list back to its default entries. For a dynamically populated list, you'll have to be sure that you call all of the events that populated it EVERY time the list is entered and remove the necessary item. If you don't cycle back through each event that could affect the list, then you run the risk of losing options in, say, the second drop down list because the first list was changed multiple times. (In the example below, the scripting for each checkbox is the same, and the scripting for the two dropdown lists are similar.)