B
Bob Howard
Using A2K, I have a ListBox with a query behind it to obtain the data to
reveal. In the application, I occasionally need to requery this ListBox
since my program can be adding, deleting and/or changing the data that might
be showing in the ListBox. I also have the need (within the VBA behind the
form) to test (immediately after the requery) whether the ListBox is empty,
and I do this by comparing its ListCount property to zero.
When the ListBox contains data, the ListCount property correctly contains
the actual number of rows of data.
When the ListBox contains no data, the ListCount property always contains
the number 1 (a positive 1).
The ListBox's ColumnHeads property is set to "No."
[p.s. --- when I test this with ColumnHeads=Yes, an empty ListBox **still**
has a ListCount of 1, but a ListBox with data has a ListCount equal to the
number of data rows plus 1 (for the header)]
Why isn't the ListCount property for an empty ListBox zero (ColumnHeads=No)?
Bob (@Marture
rg)
reveal. In the application, I occasionally need to requery this ListBox
since my program can be adding, deleting and/or changing the data that might
be showing in the ListBox. I also have the need (within the VBA behind the
form) to test (immediately after the requery) whether the ListBox is empty,
and I do this by comparing its ListCount property to zero.
When the ListBox contains data, the ListCount property correctly contains
the actual number of rows of data.
When the ListBox contains no data, the ListCount property always contains
the number 1 (a positive 1).
The ListBox's ColumnHeads property is set to "No."
[p.s. --- when I test this with ColumnHeads=Yes, an empty ListBox **still**
has a ListCount of 1, but a ListBox with data has a ListCount equal to the
number of data rows plus 1 (for the header)]
Why isn't the ListCount property for an empty ListBox zero (ColumnHeads=No)?
Bob (@Marture