Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 3rd, 2004, 04:23 PM
beoooz beoooz is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Canada
Posts: 1 beoooz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help Please - Linking a Combo box with a list box

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

Reply With Quote
  #2  
Old September 7th, 2004, 10:50 AM
QueenVBA QueenVBA is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 22 QueenVBA User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 43 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old April 14th, 2005, 11:28 AM
AnailizeR AnailizeR is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 AnailizeR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 12 sec
Reputation Power: 0
A more indepth example please

Quote:
Originally Posted by QueenVBA
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

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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Linking a Combo box with a list box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway