unclesvenno
Programmer
I have a listbox which is filled as the result of a query. No problems filing the listbox, however i want to put in a test if the listbox contains no data. I have used the MsgBox to output the size and I constantly get "1". I get this result even when the listbox is empty. I thought if I'm putting the column headings in then that may indicate a 1 if there is no other data but I don't understand why the count would remain "1" when there is clearly more than that in there?
MsgBox lsbOrderedFiles.ListCount
'Test listbox for data
If (lsbOrderedFiles.ListCount <= 1) Then
cmdExport.Enabled = False
cmdRemove.Enabled = False
cmdClearAll.Enabled = False
End If
Thanks again,
Uncle Svenno
ps. how do I put my code sample in a "code box" on this forum?
MsgBox lsbOrderedFiles.ListCount
'Test listbox for data
If (lsbOrderedFiles.ListCount <= 1) Then
cmdExport.Enabled = False
cmdRemove.Enabled = False
cmdClearAll.Enabled = False
End If
Thanks again,
Uncle Svenno
ps. how do I put my code sample in a "code box" on this forum?