Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21350

how to search a name in combobox

$
0
0
hello every one
im trying to make a search in a combobox to display in the text
need some help this basicaly the code the for the combobox but i can pick only by dropdownlist
Code:

Private Sub Form_Load()




    CmbCust.AddItem "choose a name from the list"
    Set RS = CN.Execute("SELECT * FROM Customers ORDER BY FullName")
    While Not RS.EOF
        CmbCust.AddItem RS!FullName
        CmbCust.ItemData(CmbCust.NewIndex) = RS!ID
        RS.MoveNext
    Wend
    Set RS = CN.Execute("SELECT * FROM HairDressers ORDER BY HairName")
    While Not RS.EOF
        CmbHrDr.AddItem RS!HairName
        CmbHrDr.ItemData(CmbHrDr.NewIndex) = RS!HairID
        RS.MoveNext
    Wend
   
    If NewRec Then
        Me.Caption = "new appoitment"
        CmbCust.ListIndex = 0
        CmbHrDr.Text = FrmApps.LsVwHrDr.SelectedItem.Text
        PckDate.Value = Now
        CmbStart.ListIndex = 0
    Else
        With FrmApps.LsVwApps.SelectedItem
            Me.Caption = "edit appoitment to ... " & .Text
            CmbCust.Text = .SubItems(1)
            CmbCust.Enabled = False
            CmbHrDr.Text = FrmApps.LsVwHrDr.SelectedItem.Text
            CmbHrDr.Enabled = False
            PckDate.Value = .Text
            CmbStart.Text = Right$(.SubItems(2), 5)
            CmbEnd.Text = Mid$(.SubItems(2), 1, 5)
            TxtService.Text = .SubItems(3)
            ChkRepeat.Enabled = False
        End With
    End If
End Sub


Viewing all articles
Browse latest Browse all 21350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>