Solved

listbox cannot add item

Posted on 1998-04-13
2
305 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now