+ Reply to Thread
Results 1 to 5 of 5

add items more than 25K in Combobox in VBA

  1. #1
    Registered User
    Join Date
    06-26-2013
    Location
    Pune,India
    MS-Off Ver
    Word 2010
    Posts
    3

    add items more than 25K in Combobox in VBA

    I have a ComboBox which displays list of providers at the time of form load. The problem is that i have to total 22800 number of providers resulting from query however Combobox is displaying only 20K not sure which property is causing this issue, Looking for the help.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: add items more than 25K in Combobox in VBA

    I'd look for another approach, that many items in a combobox is never useful - having a search function would help your users and make your form much faster to load

  3. #3
    Registered User
    Join Date
    06-26-2013
    Location
    Pune,India
    MS-Off Ver
    Word 2010
    Posts
    3

    Re: add items more than 25K in Combobox in VBA

    we need that this combobox to fetch the results from query and display them at the time of form load as a bussiness requirement. I have used a function to Fill this combobox where i have my query as well as dropdown value added see my code below
    Please Login or Register  to view this content.
    however this is failing for Runtime error '2176': The setting for this Property too long. for Me.cmbProvider.AddItem rs("ProvName") & ";" & rs("License)... filed so thought of confirming how we can use this additem then.
    Last edited by Amoli; 06-27-2013 at 06:14 AM.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: add items more than 25K in Combobox in VBA

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    1. Don't use addItem - especially not for that many records use the List property. AddItem is extremely slow.
    2. I don't really understand why you can't just have a search box, query the db and return the results in a list box - not only is it more user friendly; it's also infinitely faster
    3. Why is this a function? It doesn't return anything

  5. #5
    Registered User
    Join Date
    06-26-2013
    Location
    Pune,India
    MS-Off Ver
    Word 2010
    Posts
    3

    Re: add items more than 25K in Combobox in VBA

    Thanks i will look for this approach

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1