Hi:
I can add data to a combobox if there is only one colum in the combobox, now I am trying to add data to a two colums combobox using VBA code, but I keep getting this error: Run-time error "6015', can't add this item, the index is too large, here is the code:
Me.cmboCategory.ColumnCount = 2
Me.cmboCategory.ColumnWidths = "1cm; 2cm"
Me.cmboCategory.BoundColumn = 1
Do Until rst.EOF
Me.cmboCategory.AddItem rst!CategoryID, 1
Me.cmboCategory.AddItem rst!CategoryName, 2
rst.MoveNext
Loop
The error happens on line: Me.cmboCategory.AddItem rst!CategoryID, 1
Thank you very much.
Jt
I can add data to a combobox if there is only one colum in the combobox, now I am trying to add data to a two colums combobox using VBA code, but I keep getting this error: Run-time error "6015', can't add this item, the index is too large, here is the code:
Me.cmboCategory.ColumnCount = 2
Me.cmboCategory.ColumnWidths = "1cm; 2cm"
Me.cmboCategory.BoundColumn = 1
Do Until rst.EOF
Me.cmboCategory.AddItem rst!CategoryID, 1
Me.cmboCategory.AddItem rst!CategoryName, 2
rst.MoveNext
Loop
The error happens on line: Me.cmboCategory.AddItem rst!CategoryID, 1
Thank you very much.
Jt