Link to home
Start Free TrialLog in
Avatar of Plamodo
PlamodoFlag for Canada

asked on

AddItem and RemoveItem methods are unavailable for listbox

I cannot seem to gain access to the methods addItem and removeItem for a listbox in Access 2000 VBA.

The error I get is: "Compile error: Method or data member not found".

I figure its as simple as going to Tools | References and selecting the proper reference, but I can't seem to figure it out - especially since the same program worked fine at work.

Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AceDefabul
AceDefabul

AddItem and RemoveItem aren't part of the Listbox object
until Access 2002. Even then I think they are limited in the same way a ValueList is limited.

You might be interested in this article explaining how to write a class to add these two methods to a listbox or combobox in versions prior to 2002.

http://www.fmsinc.com/tpapers/97classes/index.html
AddItem and RemoveItem are methods of the ActiveX list box

Insert ActiveX Control: Microsoft Foroms 2.0 Listbox

hth
Avatar of Plamodo

ASKER

Thanks.  The manual input idea is a good one, but I think the best solution is just to update my version of Access.