M
microb0x
I have a combo box with 3 columns visible and one hidden. When
populating the cbx with records from a table I'm getting the following
error:
The setting for this property is too long.
Error Number: 2176
This is happening at the 676th record. I was under the impression a
combobox could hold way more rows than that. Can anyone shed some
light on this problem?
Here is the code from the sub that is populating this cbx:
Public Sub subFillAccountCBX()
On Error GoTo ErrHandle
sqlWHERE = "SELECT [Customer Name],[Property or
Casualty],[Office],[ID] " & _
"FROM [2006 Key Target List] ORDER BY [Customer Name]"
Set con1 = CurrentProject.Connection
Set recSet1 = New ADODB.Recordset
recSet1.Open sqlWHERE, con1, adOpenKeyset, adLockOptimistic
Do Until recSet1.EOF
'Add each record in recset1 to cbx on frmIntroPage
Form_frmIntroPage.cbxExistingAccount.AddItem ("""" & recSet1(0)
& """" & ";" & """" & recSet1(1) & """" & ";" & """" & recSet1(2) &
"""" & ";" & recSet1(3))
recSet1.MoveNext
Loop
recSet1.Close
con1.Close
Set con1 = Nothing
Set recSet1 = Nothing
ExitSub:
Exit Sub
ErrHandle:
MsgBox Err.Description & vbNewLine & vbNewLine & "Error Number: " &
Err.Number
Resume ExitSub
End Sub
populating the cbx with records from a table I'm getting the following
error:
The setting for this property is too long.
Error Number: 2176
This is happening at the 676th record. I was under the impression a
combobox could hold way more rows than that. Can anyone shed some
light on this problem?
Here is the code from the sub that is populating this cbx:
Public Sub subFillAccountCBX()
On Error GoTo ErrHandle
sqlWHERE = "SELECT [Customer Name],[Property or
Casualty],[Office],[ID] " & _
"FROM [2006 Key Target List] ORDER BY [Customer Name]"
Set con1 = CurrentProject.Connection
Set recSet1 = New ADODB.Recordset
recSet1.Open sqlWHERE, con1, adOpenKeyset, adLockOptimistic
Do Until recSet1.EOF
'Add each record in recset1 to cbx on frmIntroPage
Form_frmIntroPage.cbxExistingAccount.AddItem ("""" & recSet1(0)
& """" & ";" & """" & recSet1(1) & """" & ";" & """" & recSet1(2) &
"""" & ";" & recSet1(3))
recSet1.MoveNext
Loop
recSet1.Close
con1.Close
Set con1 = Nothing
Set recSet1 = Nothing
ExitSub:
Exit Sub
ErrHandle:
MsgBox Err.Description & vbNewLine & vbNewLine & "Error Number: " &
Err.Number
Resume ExitSub
End Sub