Combo Box question....

J

Joe

I have a client that wants this functionality in their combo boxes.

They want to be able to type in an entry into their combo box and then when
the
control loses focus, if it doesn't match a value they want to be able to add
it to
the dropdown list. However, since the dropdown is based off a query so I
can't
add it directly to the list. And since there is a lot more data required
than just
the information being type (e.g. Customer Name also need other contact info
for that customer).

My question is how do you all handle requests like this?

So, I was going to do On Lost Focus to do a lookup, if the results are Null
(or no records) then I would be opening the Add New form.
 
D

Dale Fye

Joe,

Check out the NotInList event of the combo box.

In that event, I would confirm that they want to add the NewData, and then
open your frm_Customer to a new record, adding the NewData to the appropriate
field of that table.

Assuming your combo box has an ID field as it's bound column, you will need
to get the ID value of the new customer, and after the customer is added,
requery your combo box and set its value to the new CustomerID field.

HTH
Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top