I'm stuck on this problem for about 2 days now and i still can't find a way on how to bind my data column on the combobox. need help guys i really appriciate your help.

And this is the code i have made so far.

Private Sub Form_Load()
    adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=GradingSystem.mdb;Persist Security Info=False"
    adodc1.RecordSource = "Select student_section from student_tbl"
    Set cmbBoxSection.DataSource = adodc1
End Sub

Recommended Answers

All 4 Replies

Do you HAVE to use the datacontrol? If not, there is a much easier way by just looping through the records returned...

Now i'm done in populating the combobox but the problem is the item is duplicating like for example i have two student with the same section

Student 1 - Section-1
Student 2 - Section-1

The item inside the combobax has two Section-1 instead of one section-1 only. Any tip sir

use of distinct will result in what you want(it will return only dictinct values i.e different values only)

"Select distinct student_section from student_tbl"

hope this helps you . . .

commented: Very useful! +2

Thanks rishif!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.