Solved

listbox cannot add item

Posted on 1998-04-13
2
308 Views
Last Modified: 2008-02-26
mylistbox give an error 381 whenever i try to add items to the list property in
a subroutine.
eg, private sub Additem()
dim i as integer
for i =0  to 19
listbox.list(i) = array(i)
next
end sub      
can i do the above?
if not , what should i do?
0
Comment
Question by:deuter
2 Comments
 

Accepted Solution

by:
tapsbin earned 50 total points
ID: 1461163
It seems from your question that you have already added items
to your listbox and you want to reassign the elements with the
new values.

(A) If you don't have any element in your listbox then apply
following...

Private Sub AddItem()
    Dim iCnt As Integer
    For iCnt = 0  To 19
    ListBox.AddItem = <Name Of An Array>(iCnt)
Next
End Sub

(B) If you already have the elements and wants to reassign ...

Private Sub AddItem()
    Dim iCnt As Integer

    ListBox.Clear       ' This will clear all the elements
                        ' from your listbox control.
    For iCnt = 0  To 19
    ListBox.AddItem = <Name Of An Array>(iCnt)
Next

If you are not satisfied please tell me more what do you want..
but please do not reopen...i want the points...very eager to
earn the points....

Kind Regards,

TAPS


0
 

Author Comment

by:deuter
ID: 1461164
Taps thanks for your help  it has been very useful.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 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