+ Reply to Thread
Results 1 to 12 of 12

ComboBox class .AddItem filled in class module

  1. #1
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    ComboBox class .AddItem filled in class module

    Hi Guys,

    I'm trying to create a class for a combobox where the combobox.additems are filled in the class module
    Last edited by Jacques Grobler; 07-03-2012 at 05:48 AM.
    Jacques


  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: ComboBox class .AddItem filled in class module

    That is not a question, nor does it make any sense to me as a statement.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    Hmm... Apologies...

    The question is what will the code look like if that is what I'd like to achieve?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: ComboBox class .AddItem filled in class module

    I guess you missed the second part of my comment?

    Can you explain:
    1. Why you want a class for a combobox (which already is one)?
    2. What you expect the class to do exactly?

  5. #5
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    Yes, trying to do a lot at the same time is not a good thing...

    I have a list of items that will be used over and over, almost like a template, and I have very recently found that instead of using the buttons on the toolbox and repeatedly copying the code and renaming, that I can create "additional" properties to what is available. And as such, I'd like to be able to have a list appended to a combobox, whenever I call up this new combobox, that the list is also available at an instant.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: ComboBox class .AddItem filled in class module

    Will this list never change?

  7. #7
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    No it will not, it is a list that represents a bunch of sizes available in a range.

  8. #8
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    The list consist of approx 210 items, but it is similar to "small", "medium" and "large".

  9. #9
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    Just bumping this thread up...

  10. #10
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    Anyone out there with advise please?

  11. #11
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: ComboBox class .AddItem filled in class module

    Here's one way, using a hardcoded list:
    Class called SizeList:
    Please Login or Register  to view this content.
    then in userform:
    Please Login or Register  to view this content.
    Using a hardcoded list has the advantage that the class is entirely self-contained, but will cause you problems if the list does change. If you can, I would suggest using a separate file for the data and having the class extract it from that file. Then you only need to alter the file instead of all apps that use the class.

  12. #12
    Forum Contributor
    Join Date
    01-15-2010
    Location
    Jhb, South Africa
    MS-Off Ver
    2007, 2010, 2016
    Posts
    275

    Re: ComboBox class .AddItem filled in class module

    Hi Romper

    Exactly what I need, I'll keep in mind having a seperate file for the control of content but for now, this is perfect.

+ 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