|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I'm kinda new to visual basic and am wondering how I'm supposed to link a combo box with a list box. Namely, both my combo box and list box are connected to a database I have in Microsoft Access. Combo box is showing the id, and the list box the associated names. I need the record in the list box to change to the associated name with the Id chosen in the combo box. I believe that I need to write code for the click method of the combo box but I'm not realy sure what to do or how to fit my sql commands there. Any help is highly appreciated. Thanx |
|
#2
|
|||
|
|||
|
Write code in the Change Event of the cbo
For Example: Code:
Private Sub Combo1_Change() ListBox1.Additem "Some Data from Your Database" 'Or What ever code you use to add items to the listbox End Sub Every time you change the ID the associated name in the list box changes |
|
#3
|
|||
|
|||
|
A more indepth example please
Quote:
would it be possible for you to give me a more indepth example of the code of the values the list box would show if i changed the combo value as in .. suposse we have a Table and it has an usrid, usrtype and i would like to make the listbox retrieve the usrid from the usrtype i specify on the combo so if i had: usrid usrtype ____ ______ a 0 b 0 c 2 d 1 i could type 0 on the combo and get the users a and b in the listbox..... thanx |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Linking a Combo box with a list box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|