Hello,

I have two linked tables in my database (access), one is for the student and one is the ages(selection drop list ).

When I have transfered the data in vb form, a simple text box is shown with numbers in it. How can I have the drop down list shown with the data I need instead of the numbers?

Thanks.

Use DataReader class and Add items to comboBox:

Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;data source=C:MyFolder\MyProject\myAccessDatabase.accdb"
Dim conn As New OleDbConnection(connString)
Dim sql As String = "SELECT ColumnName FROM Clientes"
Dim cmd As New OleDbCommand(sql, conn)
conn.Open()
Dim reader As OleDbDataReader = cmd.ExecuteReader()
While reader.Read()
    comboBox1.Items.Add(reader(0).ToString())
End While
reader.Close()
conn.Close()
cmd.Close()
Be a part of the DaniWeb community

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