Same Error Everytime! List1.RemoveItem (0)

Posted on 2004-08-10
Medium Priority
Last Modified: 2012-05-05
I think its trying to delete what's not there anymore.  After I press the stop button, i make it clear the lists, and disable timer. but this error always pops up afterwards.  is there a way to fix this?

In A Timer:

If List1.ListCount > 0 Then
 List1.Selected(0) = True
    Parsemeth1 (List1.List(0))
    List1.RemoveItem (0) <----------------------invalid procedure call or argument.
    If List1.ListCount = 0 Then
        Timer4.Enabled = False
        End If
        If Text44 = "0" Then
        Timer4.Enabled = False
        End If

 thank you.
Question by:andyakira
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
LVL 53

Expert Comment

by:Ryan Chong
ID: 11769623

List1.RemoveItem 0


Call List1.RemoveItem (0)

LVL 14

Expert Comment

ID: 11769974
>>>>> List1.RemoveItem (0) <----------------------invalid procedure call or argument.

Change it to :

If List1.ListCount > 0 then List1.RemoveItem (0)

Expert Comment

ID: 11770004
if u clear the list when u press ur stop button, can see how it enters the loop:

If List1.ListCount > 0 Then   <---this should be 0

also  why do u do this: List1.Selected(0) = True
                                  Parsemeth1 (List1.List(0))

when u do a:
        Timer4.Enabled = False

also set: Timer4.interval = 0.

i have a feeling this is because of multiple timers...are u disablign the correct timer?

also...set a breakpoint in this function and check the value of listcount etc..

i am also wondering if it shud be .Remove(1).....forget whats the base of a list...
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

by:Mahdi Mansour
ID: 11770779
if what u r trying is only to clear the list and stop the timer use :

Private Sub Timer1_Timer()
If List1.ListCount > 0 Then
 List1.Selected(0) = True
    List1.RemoveItem (0)
  End If
   If List1.ListCount = 0 Then
      Timer1.Enabled = False
      End If

End Sub
LVL 23

Expert Comment

by:Ioannis Paraskevopoulos
ID: 11771368
private sub Button_click()
end sub
LVL 26

Accepted Solution

EDDYKT earned 240 total points
ID: 11771776
just put

on error resume next

at the beginning


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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