Append to table on LimitToList Event

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

Guest

I would like to use Allen Browne's LimitToList code to add text from a
combobox. However, I don't understand how to add the text when there are
three fields in the table, and I need the other two fields to automatically
have their values added in this event. ie. I would like the user to type
only the name in the combobox. If is it not in the list then append to the
table (tblSenderName). The fields are SenderId, CustomerId, and Name. The
CustomerId (from tblCustomer) should match the forms cboCustomerID so I can
filter senders where Me.cboCustomer.Column(0) = tblSender.CustomerID. Is
this possible and how would I tell the form to append to the table?
 
The NotInList event is useful only when there is a single value you want to
add to the lookup table, and then only if it the primary key value.

Consider using the DblClick event of the combo to OpenForm where the user
can enter the new value. Use the AfterUpdate event of that form to Requery
the combo on the original form so it gets to hear about the new value.
 
Thank you for your help. I didn't want the user to have to DblClick and add
the value on another form for time sake. It would be just as fast if they
typed the name in the a TxtBox. If you have any other ideas please let me
know!

James Simmons
 
Back
Top