is it possible to attach a combo box to an input box ( or maybe a label or textbox) ?
be more precised, i would like to know how to get codes for combo box
thanks for advance

Recommended Answers

All 4 Replies

is it possible to attach a combo box to an input box ( or maybe a label or textbox) ?
be more precised, i would like to know how to get codes for combo box
thanks for advance

as far as i know cannot attach a combo box to an input box.. what exactly you want to do..give an example...

if you just want to get the data from the combo box...
you can use this code

Text1.Text = Combo1.List(0) 'get the data on the first position
Text1.Text = Combo1.List(1) 'get the data on the second position

thanks for your answer cguan_77... but i want to know exactly how to enter datas in combos box & to attach them in some listboxes or textboxes!
we're realizing a project & in one form we put one combo box & we want to enter datas in that combo box & to find them in the next form in some listbox or textbox, how to realize it?

To address controls in another form you need to add the form name...

Form1.Text1.Text

Good Luck

let's say you have form1 and form2 and in each form you have a combo box, list box and a text box...

combo1.additem "abc" ' enter data to combo box
list1.additem "abc" ' enter data to list box

get data from form1 and add data to form2 listbox or combo box

Private Sub Command1_Click()
Form2.Combo1.AddItem Text1.Text 'get the data in form1 text1 and add data to form2 combo box1
Form2.List1.AddItem Text1.Text  'get the data in form1 text1 and add data for form2 list box1
End Sub

get data from form2 list box and combo box and add data to form1 list box or combo box

Private Sub Command2_Click()
Text1.Text = Form2.List1.List(1)   'get the data in form2 list box1 and display data on form1 text1
Combo1.AddItem Form2.List1.List(1) 'get the data in form2 list box1 and add data to form1 combo box1
List1.AddItem Form2.Combo1.List(1) 'get the data in form2 combo box1 and add data to form1 list box1
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.