Link to home
Start Free TrialLog in
Avatar of gideonn
gideonn

asked on

Sorting a combo box that doesn't have a "Sort" property

  Below is my INI sub that fills all of the various objects on my form.  I fill a combo box on this form from a table in a database as shown...  However, the combo box always is out of order even thought the table is alphabetical....  Can anyone help me?!?  Thanks!


----------  CODE ----------
    ' Assigns default values to variables
    strReportTable = "SupervisorQuery_tbl"
       
    ' Opens a connection to CACS Dollars Database
    conCACS.Open "Provider=microsoft.jet.oledb.4.0;" + _
       "Data Source=" & GetPath & "FS Admin.mdb"
   
    ' Opens table from database
    recCACS.Open strReportTable, conCACS, adOpenKeyset, adLockOptimistic
   
    Do Until recCACS.EOF
        With recCACS
             
           ' Get CustName and Location Code
           SupNameCB.AddItem !LASTNAME & ", " & !FirstName
           
         .MoveNext
        End With
    Loop
     
    ' Closes table and database connections
    recCACS.Close: conCACS.Close
---------  BREAK --------
ASKER CERTIFIED SOLUTION
Avatar of Shauli
Shauli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial