Results 1 to 9 of 9
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List Box Limit (97SR2)

    Does anyone know the limit to the number of items in a combobox or list control?

    I'm trying to put 1300 items (.additem) in a combobox (I know, poor programming practice). It's not working (items are missing). Just wondering if I'm running up against some limit.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: List Box Limit (97SR2)

    The limit is based on the length of the string, and the way to get around it is to use a callback routine to populate the list instead of AddItem.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    Well, thank you for that insight. Say, would you happen to know what a callback routine is? I sure don't except it has something to do with Windows API calls.

    Would you care to elaborate. IOW, how about some code? <img src=/S/drop.gif border=0 alt=drop width=23 height=23>
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    Kevin,

    Check out AddressOf in VBA Help, which might give you an idea (and some code) of what is involved. Using callbacks involve sending the address of you procedure to say an API function, so that the function can interact with you procudure. VBA provides the AddressOf operator for this purpose.

    Andrew C

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    I was just scouring the help when you called!

    Word 97 (VBA 5) doesn't say much about it. I found some VBA code that uses AddressOf but it doesn't work in 97.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    Kevin,

    The following is the help entry in VBA (Excel 2000) - I think that AddressOf was not included prior to Office 2000, though may have been included in VB 5.<blockquote><hr>A unary operator that causes the address of the procedure it precedes to be passed to an API procedure that expects a function pointer at that position in the argument list.

    Syntax

    AddressOf procedurename

    The required procedurename specifies the procedure whose address is to be passed. It must represent a procedure in a standard module module in the project in which the call is made.

    Remarks

    When a procedure name appears in an argument list, usually the procedure is evaluated, and the address of the procedure

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    It looks like I'll not be able to use AddressOf. Though a search in the VBA help shows two references, the code sample just will not work -- error on the AddressOf reference.

    Thanks for your help.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: List Box Limit (97SR2)

    Kevin,

    Sorry, I didn't mean to be abstruse, and I've been out of town for a couple of days. Lookup Callback in the Find tab of on-line help and then pick the Callback property example. If you scroll down in the article, you'll see an example of a simple callback routine. You can also take a look at <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=acc&Number=20058&page=& view=&sb=&o=&vc=1#Post20058>this post and thread</A> in Access, where Andy Ainscow posted a callback routine for populating comboboxes. It should work in 97 just fine.
    Charlotte

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Box Limit (97SR2)

    Charlotte,

    Thanks very much. I'll check this out...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •