NotInList Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a menu form that has 5 command buttons and a combo box with the record
source being a query. Simple enough so far... For 3 of the command buttons,
I want to require the user to select a row in the list, but for the other 2
command buttons, I'll add the "new" selection typed. How can I detect which
command button was clicked when the NotInLIst event is triggered? Thanks for
your help and time.

MikeBromley
 
The NotInList event is triggered by typing a value into the combobox that
doesn't exist in the list. I don't understand how you could be clicking on a
command button "when the NotInList event is triggered"
 
Douglas, thank you for the response. Yes, my code is triggered by the
property on the conmbo box On Not In List, but unless I misunderstood the
event, it only gets executed by some action. By simply typing in the combo
box an entry that doesn't exist, but doing nothing else, nothing happens,
right? So, when my code in the NOt IN LIst gets triggered, I want to know
which command button triggerd Access to launch my NOt In List code. Does
that make sense??

MikeBromley
 
As I said, the NotInList code is executed by typing in the combobox, but the
LimitToList property of the combo box must be set to True.

I'm not sure whether you could trigger the code by clicking on a command
button.
 
Thanks again, Douglas for your time. I'll look deeper into the property
LImitToList. But just for clarification... simply typing in the combo box an
entry that doesn't exist doesn't trigger anything. The design of the menu
form only lets the user click on 1 of 5 command buttons to cause action upon
the selected list entry. Simply hitting the "enter" key isn't one of his
options. For 2 of the 5 buttons, I want my code in the NotINList Sub to add
the entry, but for the other 3 buttons, I don't want to allow a "new" entry.
Rather, I want to tell him he must pick an existing list entry. Perhaps I
have a poor design?

MikeBromley
 
As I said, I don't believe you're going to be able to get that to work in
conjunction with the NotInList event. The fact that you move focus from the
combo box to the command button to click on it is going to cause the
NotInList event to fire.
 
Back
Top