How to determine if a listbox is full

jaccessable

Registered User.
Local time
Yesterday, 16:08
Joined
Feb 12, 2016
Messages
13
Is there a way to easily determine if a listbox is full. Ideally, it would be great if there was a listbox.size property that I could check after each listbox.additem, but there isn't. My problem is that I'm using a 10 column listbox that fills up right around 320 lines of data (32K) - plus or minus. Just some of my data exceeds the limit. Oddly, while attempting to overfill any other control would generate an error, trying to listbox.additem when the listbox is already full doesn't generate an error - it just keeps attempting to fill it until the do until loop is complete. So, my clunky workaround on this is to add an item, move to the last item in the listbox and count the items in the listbox every time to see if it grew. So, any ideas beyond that?

Just FYI, I plan to split the listbox into 2 later to deal with this permanently. But right now, I just need a reliable and easy way to notify users that only partial data is displaying.
 
why would you require users to scroll through that many rows?

not quite sure what you mean by listbox size, but if referring to the number of rows, the listcount property (mylistbox.listcount) will give you the current number of rows

You would be better off using a subform
 
Some divisions have over 320 lines of general ledger accounts that they need to enter a budget for. Most divisions see a complete list of accounts, but it's being cut off for a few that exceed the 32K data limit.

My idea of listbox.size would be to return the amount of data in bytes that the listbox is using. If I could see the bytes exceeding the maximum, I could notify users that the list of accounts is incomplete and further filtering is required.

The listbox row count is my current clunky workaround.

Thanks
 
I guess I'm not understanding. How/Why would a subform allow me to show more than 32K of data in a list box or see the size of the list box?
 
The 32K character limit is only on List RowSources.

Use a Table/Query RowSource.
 

Users who are viewing this thread

Back
Top Bottom