combolist data selecte with textbox relation

Reply

Join Date: Oct 2009
Posts: 2
Reputation: Salman Attari is an unknown quantity at this point 
Solved Threads: 0
Salman Attari Salman Attari is offline Offline
Newbie Poster

combolist data selecte with textbox relation

 
0
  #1
31 Days Ago
I have one combo box “cboitemname” and one text box “itemcode” in vb6 form,I have a table “stock” in sql server 2000 database where data about item name and its code is present, in rutime I want to disply item code of item that I select from combolist, how should I do this?
Last edited by Salman Attari; 31 Days Ago at 2:27 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #2
31 Days Ago
I think you get idea from it.
Attached Files
File Type: zip data show in combobox.zip (13.4 KB, 2 views)
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 248
Reputation: AndreRet is an unknown quantity at this point 
Solved Threads: 35
AndreRet AndreRet is offline Offline
Posting Whiz in Training
 
0
  #3
31 Days Ago
As follows -

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set rsItemName = New ADODB.Recordset
  2.  
  3. rsItemName.Open "......", cnItemNAme, adOpenStatic, adLockOptimistic 'Where open is your connection string
  4.  
  5. If rsItemName.BOF = True Then
  6. Exit Sub
  7. ElseIf rsItemName.EOF = True Then
  8. Exit Sub
  9. Else
  10. Do While rsItemName.EOF = False
  11. cmbItemName.AddItem rsItemName("ItemCode") 'ItemCode is the name of your field
  12. rsItemName.MoveNext
  13. Loop
  14. End If
Please mark questions as answered when done.

Be the ONE!!!
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC