First question : Why do you want to clear the text in the combobox ?
It is more usefull to make a default selection directly after having initilized the comboboxe's values, this usage avoids also some other possible errors.
Klaus: I need to have it clear when I add a new DailyTarget entry. The field has no default - I have designed it this way.
Jotha: use the Add method of the combobox to add new items. If you store them in a database then you'll need to add a new record to it too. I'm using SqlLite as my database.
You can do it that way:
- add a TextBox, where the user can input the new text.
- add a Button, when clicking it, the program adds the new text in the Combobox.
- save all the values and their number in aread this file at file when closing the program
- read this file at the start of the program and initialize the ComboBox.
Adding new items is simple enough, you just need to use ComboBox1.Add("value")
If you want to save this for the next time the program is loaded then you need to store the values somewhere.
This could be an ini file or the simplest method would be to use a table to store the values, saving and loading to a csv file.