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

[RESOLVED] how to add a combobox Name to be the default

$
0
0
i have a code that displays some values from a table to a combobox
now when i open a new form
the combobox is empty
i did some coding but the first named displayed goes to the texr which i dont want
i just want to add a title in the combobox and this user cannot add this specific title
this is my code
Code:

  CmbHair.AddItem "Please choose a name from the list" ' here it displays in a text which i dont want
    Set rs = CN.Execute("SELECT HairID, HairName FROM HairDressers ORDER BY HairID")
        Do While Not rs.EOF
        CmbHair.AddItem rs!HairName
        rs.MoveNext
      Loop
  CmbHair.ListIndex = 0

Code:

txtBody.text = CmbHair.List(CmbHair.ListIndex)
how do i add only what is in the list and not the "Please choose a name from the list?
tnx in advanced
salsa 31

Viewing all articles
Browse latest Browse all 21114

Trending Articles



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