Question Input from another form

anil3b2

Member
Joined
Jun 19, 2009
Messages
14
Programming Experience
1-3
I have form 1 having combo box with some items. I have an item called "Add New". If the user selected "Add new" i need to pop up form 2 which having one textbox and save button. when the user clicks the save button i need to add the textbox text in to form 1 combobox items.

How can i do this? I am struggling with this. It would be great if anyone post me code for this.
 
Whant exactly you aren't able to do?
Once selected the "add new" item in combobox1 of form1,
you simply open the new form.
form2.show()
Note that you must have already made that form and named it form2.
(form2 is the one with a textbox and a button).
Now, in the button click event of form2:
if textbox1.length = 0 then
exit sub
end if
form1.combobox1.items.add(textbox1.text)
me.close()

With this script, when the user click the button1 in form2, if textbox1 in form2 is not empty, combobox1 in form1 will have a new item and form2 gets closed.
Adjust this script, because i wrote it without checking if correct and because
you have to replace some words with the real names in your project.
 
Back
Top