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

[RESOLVED] Combobox Sorting

$
0
0
Hi
I use the following code to populate a combobox is it possible to
sort the list before I index.
Code:

  'Load Combo Data
    With frmTopControl
      If Control.myRset.RecordCount > 0 Then
        Set .dgCombo.DataSource = Control.myRset
            .dgCombo.Columns(0).Width = 2000
            Me.cboCodes.Text = "Country List"
          Do While Not Control.myRset.EOF
              strCombo(i) = .dgCombo.Columns(0)
                Control.myRset.MoveNext
                  Me.cboCodes.AddItem strCombo(i), i
                  'stop UK from being Deleted or Edited
                  If strCombo(i) = "United Kingdom" Then cboCodes.ItemData(cboCodes.NewIndex) = 1001
                  i = i + 1
          Loop
      End If


Viewing all articles
Browse latest Browse all 21847

Trending Articles



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