ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filling a Combobox 10 th column (https://www.excelbanter.com/excel-programming/393300-filling-combobox-10-th-column.html)

sharon

Filling a Combobox 10 th column
 
Hi,

I'm filling a combobox with 10 columns, it works fine.
Now I need to add a new column, so I set

..ColumnCount = 10, and here it crashes.


If Len(Trim(rsINVOICES.Fields(10).Value)) 0 Then
.List(.ListCount - 1, 10) = (rsINVOICES.Fields(10).Value) '
<- value is 6055
Else
.List(.ListCount - 1, 10) = " "
End If


Tim

Filling a Combobox 10 th column
 
What's the error message ?

Tim

"sharon" wrote in message
...
Hi,

I'm filling a combobox with 10 columns, it works fine.
Now I need to add a new column, so I set

.ColumnCount = 10, and here it crashes.


If Len(Trim(rsINVOICES.Fields(10).Value)) 0 Then
.List(.ListCount - 1, 10) = (rsINVOICES.Fields(10).Value)
'
<- value is 6055
Else
.List(.ListCount - 1, 10) = " "
End If




Tom Ogilvy

Filling a Combobox 10 th column
 
Read the help on columncount. You are limited to 10 columns unless you bind
the control to the worksheet.

Here is the quote from the help file:

"For an an unbound data source, there is a 10-column limit (0 to 9)."

--
Regards,
Tom Ogilvy


"sharon" wrote:

Hi,

I'm filling a combobox with 10 columns, it works fine.
Now I need to add a new column, so I set

.ColumnCount = 10, and here it crashes.


If Len(Trim(rsINVOICES.Fields(10).Value)) 0 Then
.List(.ListCount - 1, 10) = (rsINVOICES.Fields(10).Value) '
<- value is 6055
Else
.List(.ListCount - 1, 10) = " "
End If


sharon

Filling a Combobox 10 th column
 
Tom,

Thanks for your help.

I'm sorry I didn't see it, because I had to travel these dates.

I appreciate your help.




"Tom Ogilvy" wrote:

Read the help on columncount. You are limited to 10 columns unless you bind
the control to the worksheet.

Here is the quote from the help file:

"For an an unbound data source, there is a 10-column limit (0 to 9)."

--
Regards,
Tom Ogilvy


"sharon" wrote:

Hi,

I'm filling a combobox with 10 columns, it works fine.
Now I need to add a new column, so I set

.ColumnCount = 10, and here it crashes.


If Len(Trim(rsINVOICES.Fields(10).Value)) 0 Then
.List(.ListCount - 1, 10) = (rsINVOICES.Fields(10).Value) '
<- value is 6055
Else
.List(.ListCount - 1, 10) = " "
End If



All times are GMT +1. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com