472,980 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,980 software developers and data experts.

Remove ALL items from ListView?

rdi
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)
Nov 20 '05 #1
4 4707
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #2
rdi
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1
--

RDI

(remove the exclamation from the email address)

"rdi" <rd**@writeme.com> wrote in message
news:us**************@TK2MSFTNGP11.phx.gbl...
Why does the following NOT remove the items from the ListView? I need to
remove all the items and re-build the LV based on new information.

Thanks.

--

RDI

(remove the exclamation from the email address)

If lvwFilter.Items.Count > 0 Then

For k = lvwFilter.Items.Count - 1 To 0

lvwFilter.Items.RemoveAt(k)

Next

End If
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #3
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #4
On 2004-04-10, rdi <rd**@writeme.com> wrote:
never mind. It's happened again. Lately it seems as though just taking the
time to try and explain my problem to you guys quite often leads me to the
answer.

I changed For k = lvwFilter.Items.Count - 1 To 0

to For k = lvwFilter.Items.Count - 1 To 0 Step -1


Can't you just call lvwFilter.Items.Clear?

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
"There was a point to this story, but it has temporarily
escaped the chronicler's mind."

- This line perhaps best sums up the whole book.
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rdi | last post by:
Why does the following NOT remove the items from the ListView? I need to remove all the items and re-build the LV based on new information. Thanks. -- RDI (remove the exclamation from...
2
by: Mamatha | last post by:
Hi I have an application with listview.When i click on one button the data will be displayed like this in the listview: colA colB colC ----- ----- ------...
7
by: Progalex | last post by:
Hi everybody! I have a listview and a treeview in a form . With an OpenDialog I let the user select multiple files and then these files are added to the listview with the complete pathname,...
6
by: Nick | last post by:
Hi there, I'm trying to implement drag-drop for my listview control in large icon view mode. Unfortunately the order of the items gets completely messed up upon inserting the item back into the...
7
by: Mike Johnson | last post by:
How do I remove a item that's been selected from a listview? I'm using Visual Basic 2005 express edition. Thanks
2
by: Kela | last post by:
An interesting problem: I have a ListView with LabelEdit set to TRUE. When I change the label, I want to make some decisions as to whether the ListViewItem (that's just been edited) should stay in...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.