VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Fill ComboBox with values from database

by gabio (9 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Fill ComboBox with values from database

Rate Fill ComboBox with values from database



On Error GoTo err
    cbo.Clear
    Dim aRec As New adodb.Recordset
    aRec.Open sqlString, aCon
    fillCombo = True
    Do While Not aRec.EOF
        cbo.AddItem aRec(strField)
        aRec.MoveNext
    Loop
    aRec.Close
    Set aRec = Nothing
Exit Function
err:
    fillCombo = False
    MsgBox err.Description
End Function


Download this snippet    Add to My Saved Code

Fill ComboBox with values from database Comments

No comments have been posted about Fill ComboBox with values from database. Why not be the first to post a comment about Fill ComboBox with values from database.

Post your comment

Subject:
Message:
0/1000 characters