04-24-08, 14:30 #1Registered User
- Join Date
- Jan 2006
Unanswered: Implementing AddItem method in MS Access 2000
I'm developing an application in MS Access 2000 (using MS Access 2000 forms). I need to retrieve data from oracle server and populate listbox/combobox with records from the recordset. However I found that MSAccess 2000 does not support the 'AddItem' method (the method was introduced later). Can anyone suggest some work-around to implement AddItem method?
I'm retrieving only one column of the table from the oracle database which needs to populate my list/combo. Also I'd like to mention here that the no. of records fetched is about 25000. So my concern is will MSAccess 2000 list/combo support such a big no. of rows?
I'd appreciate if anyone could help with a piece of code as an illustration.
Thanks in advance.
04-24-08, 17:36 #2www.gvee.co.uk
Provided Answers: 10
- Join Date
- Jan 2007
The word around is to append the item to the rowsource list, separaing each item using a semi-colon.
"item1; item2; item3; ... ; itemN"
With this in mind - you realise that you will have to loop through a recordset to append each item and if you're returning 25K rows, that's not exactly going to be quick.
Remember that no user can absorb that much information at once, so don't give it to them like that. Imagine if Google spat out all it's results on a single page instead of spreading them across multiple ones!
Clever design is your friend. If you were to explain what these records and their uses were, perhaps you may get more accurate guidence on how to serve it up to your users.
04-25-08, 02:01 #3Moderator
- Join Date
- Dec 2004
- Madison, WI
What I do is add to a variable as I'm looping through the values...ie...
SomeVar = SomeVar & ";" & rs!NewValue
and then when the loop is done, I set the rowsource to SomeVar (where the rowsource TYPE is a Value List instead of a query or Field List.)
It accomplishes the same thing but instead of using .additem, you add to a string variable. When it's all done, you then set the rowsource to that string variable. Only problem is that you can store only so much text in a variant and then to a rowsource. You'll most likely hit the limitation with 25000 so as georgev suggested, you might want to think about breaking it up somehow (perhaps grouping the values in a way or select grouped values dependant upon another value on the form selected so you're not trying to return all 25000 at once.)
Last edited by pkstormy; 04-25-08 at 02:09.Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)