I am trying to populate a listbox with an ADO recordset that contains data with internal commas. Normally, I just double-double quote these and everything is fine:
Do Until rs.EOF
Me.MyList.AddItem ("""" & rs!MyField & """")
rs.MoveNext
Loop
But this time, the listbox is not getting populated with the entire recordset. It just seems to be arbitrarily cutting off part way through the dataset. I have checked that the ADO query itself is returning the correct number of records, and I have inspected the data to see if there is anything unusual going on at the point where the failure occurs, but I see nothing special about the records that aren't being added properly.
If I try to eliminate the internal commas using the Replace function prior to adding the item to the listbox, I get a few more records successfully added, but still not all of them. I also tried wrapping the data in Chr(34), to no avail.
Some sample data in the field I'm trying to get into my listbox:
ABCD, NW1/4
DWER E 1/4, N 1/4
TREWE
WERT, NW1/4 & NE1/4
etc.
It will get through 573 records that look just like these and then stop, even though the next 110 records have the same characters and general pattern.
Duluter
Do Until rs.EOF
Me.MyList.AddItem ("""" & rs!MyField & """")
rs.MoveNext
Loop
But this time, the listbox is not getting populated with the entire recordset. It just seems to be arbitrarily cutting off part way through the dataset. I have checked that the ADO query itself is returning the correct number of records, and I have inspected the data to see if there is anything unusual going on at the point where the failure occurs, but I see nothing special about the records that aren't being added properly.
If I try to eliminate the internal commas using the Replace function prior to adding the item to the listbox, I get a few more records successfully added, but still not all of them. I also tried wrapping the data in Chr(34), to no avail.
Some sample data in the field I'm trying to get into my listbox:
ABCD, NW1/4
DWER E 1/4, N 1/4
TREWE
WERT, NW1/4 & NE1/4
etc.
It will get through 573 records that look just like these and then stop, even though the next 110 records have the same characters and general pattern.
Duluter