Hi thx607,
How large of number are you putting into your “iListItemsCount” variable? If it is outside the range of an integer, you most likely would then receive this error. I believe the range would be -32,768 to 32,767. You could try changing your variable definition from an Integer to a Long and see if that fixes your problem. With that being said, if this does fix your problem and this count represents the number of items you are actually putting in a list box control, you may want to think of a way to limit the number of items you are presenting to your user. We normally wouldn’t recommend putting thousands of records into list box or combo box controls do to various reasons such as performance and in addition to this users tend to find it difficult finding what they are looking for when having to scroll through that many options.
Overflow error - http://msdn.microsoft.com/en-us/library/hzsytfc8(VS.80).aspx
The Integer, Long, and Byte Data Types - http://msdn.microsoft.com/en-us/library/aa164754(office.10).aspx
Hope that helps.
Best Regards,
Nathan Ost
Microsoft Online Community Support
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.