How are you trying to assign values to the columns now?
Method1 (Using a comma delimiter)
MyListbox = "FirstColumnRow1,SecondColumnRow1;FistColumnRow2,SecondColumnRow2"
Method2 (Using SQL to fill the listbox)
strSQL = "SELECT myTable.FirstColumn, myTable.SecondColumn FROM myTable;"
myListbox.RecordSource = strSQL
myListbox.Refresh
These methods work in Access but not in VB, which uses an AddItem method to add listbox items.
Important: You must set the ColumnCount property to the number of columns you want to include on the listbox and the ColumnWidths property to the width of each of the columns to be included. The code below will set up 4 columns with only the first column (0) to be displayed in a two inch width display. The bound column that will be loaded into the database is column 0.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.