?
Solved

AddItem and RemoveItem methods are unavailable for listbox

Posted on 2003-02-26
4
Medium Priority
?
1,053 Views
Last Modified: 2012-05-04
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?
0
Comment
Question by:Plamodo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 300 total points
ID: 8028196
AFAIK AddItem and RemoveItem cannot be used for form list boxes in Access 2000 (but I could be wrong about this). They are only relevant to command bar combo boxes, although they can be used to add items to list boxes in Access XP.

You may need to use other methods to add information to your list box, such as manually appending your data to the RowSource (if it is a value list):
Me!ListBox0.RowSource = Me!ListBox0.RowSource & ";SomeData"
0
 
LVL 1

Expert Comment

by:AceDefabul
ID: 8028283
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
0
 
LVL 1

Expert Comment

by:RobaJob
ID: 8041174
AddItem and RemoveItem are methods of the ActiveX list box

Insert ActiveX Control: Microsoft Foroms 2.0 Listbox

hth
0
 
LVL 6

Author Comment

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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question