1 (edited by kweatherhead 2021-01-08 08:48:30)

Topic: Populating Combobox with Add New Entry

Greetings,

I want to use a ComboxBox type of Control to show a list of available customers...  is there a way to put an
"Add New Customer" at the top of the ComboBox ahead of existing Customers in the Customer Table?

And then by selecting that entry go into the "Add New Customer" processing rather than using a Button
to initiate the Add New Customer form & routine?

Just looking for a different method than always having to use Button to select Add or Edit.  I could put a dummy
record in the Customer File but that is just kind icky in my mind.

Thanx,
Keith

2 (edited by derek 2021-01-08 18:55:07)

Re: Populating Combobox with Add New Entry

Hi Keith,
As always, there are different ways to do it (apart from the usual 'click the add' button).  It really depends how convoluted you want to get!
Personally, I think a good balance might be to go with a variation of your 'dummy' record.
In the attached example (sorry, it's not customers but countries, but the principle is the same)
1.  I add a country called '+' to my countries table
2.  I add a tablegrid filter (country <> "+"  (see screenshot1)) to exclude it from any displays where countries are listed (see screenshot2).
3.  But any comboxes where I might want to add a country that isn't in the list, the "+" is available (see screenshot3).
Then if the user clicks the "+", it calls the approrpriate form when new details can be added.
All of the above works irrespective of whether you've made the combobox searchable or not.
A second option (very easy) is simply to replace the 'combobox add' button with something a bit less intrusive - in the attachment, you can also click on the 'Country' label (form2.label4) - it's underlined and the cursor changes to a hand-pointer to let the user know that there is functionality behind the label.
A final way might be to re-assign the 'right-click' but that gets pretty tortuous and I don't think the end result is any neater than the above.
Don't know if anyone else has different ways.
Derek.

Post's attachments

Attachment icon kw combobox1.zip 1.3 mb, 281 downloads since 2021-01-08 

Re: Populating Combobox with Add New Entry

Derek,

Once again you post a perfect example of what I really wanted to do.
Thanx for your willingness to share.

Regards,
Keith