on 01-16-2009 12:34 PM
Hi All,
i am having a combo box and a text box...Combo box is already loaded with some static values.If i am entering any data in the text box and if i am clicking the add button, that data should also be loaded in that combo box....How to do this...?
In the click event of the button, add this code
dim textvalue as string
textvalue = oform.items(itemnumber).specific.value
ocombobox.validvalues.add(textvalue, textvalue)
itemnumber is the uniqueid of the text box and ocombobox is the reference to the combo box.
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Rahul,
I had loaded the combo box with validvalues (which, i had already given in XML). Other than that, i want to load the combo box with the values which i had given in the text box. (Validvalues + Textbox values). By using your code, the value which i had given in textbox got added in the combo box. but when i close that screen and opens it once again means, only the valid vales which i had given in XML remains in the combo box. The values which got added through the textbox is not available in the combo box....This is my issue....
That's correct. It will not have the values you loaded from the text box, because those values are not saved any where else.
There are 2 options, one you can create a table, and add the values there. This way, at the time of loading the form, create a procedure to load the values from the table into the combo box valid values.
Second, you can save the values in a text file and load them from there, using basic file handling functions of vb.
The first one will be easier and more robust though. When some values are added in the text box, you can simply add a new row in the table, with the new value.
Rahul
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.