Empty Listviews

QuantumCat
09-03-2003, 11:57 PM
I have a datbase program that holds a lot of listviews.
I like a database to be "visual". The listviews give me a lot of overview on things.

Now every once in a while my listviews turn up empty (they are all in different windows).

Is there (again I couldn't find probablty because I don't know where to look) to have VB go and see if the LV is empty?


I mean something like:
if ListView1.listitems = empty Then(refresh ListView1)?

BlueDragon
09-04-2003, 12:04 AM
If ListView1 = "" then
ListView1.Refresh

Try this in the form load property

QuantumCat
09-04-2003, 12:57 AM
No, doesn't work - he treats ListView1 = " " as an incomplete syntax
VB expects something like
ListView1.Listitems(j) or
ListView1.Listitems(j).item(i)
which both give an error (index out of bounds or something)



If ListView1 = "" then
ListView1.Refresh

Try this in the form load property

irri
09-04-2003, 01:09 AM
this should work

If (listview.ListItems.Count = 0) Then

BlueDragon
09-04-2003, 01:09 AM
Did you have "" or " ", theres a big difference.

QuantumCat
09-04-2003, 02:04 AM
both -actually :-)
and I didn't try the count with () on each side

:-)

thnx


Did you have "" or " ", theres a big difference.

QuantumCat
11-16-2003, 11:57 PM
BTW most of my empty listviews were due to not clearing the headers, so everytime I made a refresh of the listview VB built it next to the prevrious giving a 15x22 columns with 77 rows before running out of workspace -hence the blank LV's

QC

both -actually :-)
and I didn't try the count with () on each side

:-)

thnx


Did you have "" or " ", theres a big difference.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum