mat wrote:
[Quoted Text] >In article <6e586148-1533-4da8-bd00-52e0d7890bb5 >[ at ]o40g2000prn.googlegroups.com>, moosecck[ at ]gmail.com says... >> I have a form that uses a combo box called txt_Status with 3 options, >> Draft, In Process and Approved. When the Status box is Approved, it >> pushes the persons name from the thru code by using Environ >> ("Username") to a combo box called txt_Senior. Txt_Senior is a combo >> box with 6 persons names in the list. It also has Limit to List >> enabled. I have code in the Not in List of txt_Senior that tells >> anyone whose name is not in the list to see their supervisor. My >> problem is when the persons name is pushed into the txt_Senior box >> where the Limit to List is enabled and the persons name is not in the >> list, the NotInList code is not triggered. If I type the same name >> into the txt_Senior box the NotInList code is triggered. Why is it >> that when the name is pushed in the code does not work but when I type >> the same name into the txt_Senior box the NotInList code is triggered? >> >> >I'm not sure why this is true but by design many form events are only >triggered by user interactions. Seemingly parallel actions carried out >in code don't trigger the events. > >I've not needed to deal with the specific issue you've asked about, but >you should be able to work around it by testing the list in code for a >match, and if a match is not found, fire the not in list event.
It is not necessary to search the list for a match. The ListIndex property will be -1 if the the value is not in the list.
-- Marsh MVP [MS Access]
|