Combo box with value and text in VB 6

VB 6 Combo box with value and text
1. Add component Microsoft Forms 2.0
2.

EngMatchFrm.CmbEngComponent.Clear
    EngMatchFrm.CmbEngComponent.ColumnCount = 2
    EngMatchFrm.CmbEngComponent.ColumnWidths = “0 in; 2 in”
    Dim i As Integer
    i = 0
    While Not rstComp.EOF
   
        EngMatchFrm.CmbEngComponent.AddItem rstComp!BusinessUnitID
        EngMatchFrm.CmbEngComponent.List(i, 1) = rstComp!BUName
       
        i = i + 1
        rstComp.MoveNext
       
    Wend

Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>