Incompatible .AddItem function in Access2000

phil_s

New member
Local time
Today, 10:43
Joined
Mar 12, 2008
Messages
7
Hi all,

I have been caught by what I think is a classic compatibility issue.

I have created a list screen that uses ADO to access a database located on a remote drive. In Access2003, the following code works fine and my list box gets populated correctly:

lessonList.AddItem (tempString)
rsLessons.MoveNext
tempString = ""

However, when I use this in Access2000 I get a compile error on the AddItem function...... Damn......

So do you know any way to get over this, is there a classic way of populating a ListBox in Access2000 from an ADO list, or does it really need to be a listbox bound directly to a query or table in the access instance you are running (e.g. the physical client?)????

All your help would be appretiated......
 
Have you set a reference to ADO in access 2000?
 
i thought that in order to bind cbo boxes and lisr boxes to data tables, MS modified the behaviour of these, so that you cant use constructs such as additem.

you have to amend the underlying table, and requery the data

there are techniques for populating the lists in other ways (ie unbound), but i dont think you will get an additem, or removeitem as such

if you think about it, if a list is bound, you cant add anything to it directly
 
thanks for the response

Thanks for the response but I think I have my terminology a bit mixed up.

On thr form that defines the list box, the box is UNBOUND, and I then use ADO to read the database that is on a remote drive. I then use the .AddItem function to add the returned data to the list box. As I said, in Access 2003 this works fine, but in 2000 it gives a compile error on the .AddItem (for obvious reason of the function is not available).

As I'm a newbie at this, could somebody point me to a good example of how to populate a list box from an ADO recordset in Access 2000.... it would be much appretiated as it's driving me mad.

Again thanks for response so far!!!!
 

Users who are viewing this thread

Back
Top Bottom