borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Oracle Database A Beginner\'s Guide Free Ebook)Next Topic (Add Table to Access database) New Topic New Poll Post Reply
AndreaVB Forum : Database : Bind Combo box to Access Table
Poster Message
mrcoolcurrent
Level: Graduate

Registered: 19-01-2007
Posts: 12

icon Bind Combo box to Access Table

Please I need help. How do I  bind a combo box to an access table so that the combo box would read the content of the access table.


[Edited by vbgen on 07-03-2007 at 12:42 PM GMT]

01-03-2007 at 11:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
subodh
Level: Trainee

Registered: 03-03-2007
Posts: 1
icon Re: HELP!!! URGENT!!!!

Its simple
Take that field in recordset and add in combo
e.g
Dim rst As New ADODB.Recordset
rst.Open "select nbranch_code,vcbranch_name from branch_master", conn, adOpenDynamic, adLockOptimistic
'If rst.RecordCount > 0 Then
If Not (rst.EOF And rst.BOF) Then
With rst
    cmbbranch.Clear
    .MoveFirst
    Do Until .EOF
        cmbbranch.AddItem .Fields(1)
        .MoveNext
    Loop
End With

-----------Try It

03-03-2007 at 10:26 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: HELP!!! URGENT!!!!

Either there's a special combobox for ADO stuff, or the normal control has "datasource" and other properties -- HOWEVER it requires a ADO data source or such on the form as well.  It is easier to just populate the combo box with the data from the database yourself.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

03-03-2007 at 09:47 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : Database : Bind Combo box to Access Table
Previous Topic (Oracle Database A Beginner\'s Guide Free Ebook)Next Topic (Add Table to Access database) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder