|
Question : Unchangeable Combo Box
|
|
I know, why owuld you put a ocmpbo box on the screen and not allow the user to change the contents? It has to do with the way the app evolved. Here is the situation:
I have a combo box on a form that shows a part number. Under previous system rules the user could select a part from the drop down. New system rules say the user cannot change the part number in this manner. I know I could lock and disable the field so the user cannot even enter it and that would solve the issues. However, there is more information in the drop down that just part number. There is factory, quote ID and some other information that the user wants to be able to see as reference, even though they can no longer change the part number.
so I owuld like the user to be able to see the drop down, I changed the number of lines listed in the combo box to 1 so they will only see the information related to the current part. However, if they make a mistake and scroll the dropdown ot another part and select it I want a message to come up telling them that they can't do it "Part Number cannot be change here". I also want the original contents of the part number field to stay intact and unchanged.
The field is called quoteID.
I have played with the 'before update' event, the 'change' event, tried using 'me.QuoteID.undo' etc.. and can't come up with the magic combination.
I can always get the message to come up in the before update event but if I set cancel to True I get the weird Access generated message about being unable to save to the database. If I don't set Cancel = True and use ME.QuoteID.Undo the changed value remains in the field.
I want this to be seemless to the user if they make a mistake. A warning mesage, the original content of the field intact and business as usual.
Any ideas?
|
|
Answer : Unchangeable Combo Box
|
|
Sorry ... been slammed with meetings all day at work (still am). Man, I am just not seeing why this is happening ....
Just a long shot ... on the combo box ... is the 'Column Heads' property set to Yes? If so, set it to No.
mx
|
|
|
|