Solved

Clone a ComboBox in VB6

Posted on 2008-11-02
7
416 Views
Last Modified: 2013-12-20
I have a form with 20 comboboxes, all of the have the same information, i am full them with a query result, but my question is, is there a way i can clone one of the (the first)? and i don´t have to loop trought all in order to fill the 20 comboboxes.
0
Comment
Question by:emviruena
  • 4
  • 3
7 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22863050
why not fill them "at once" instead of filling them 1 by 1?
you could of course "copy" all the items of the first into all the others, but why loop several times?
0
 

Author Comment

by:emviruena
ID: 22863058
i fill them "at once", but still be so slow.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22863080
how many items are there in the lists?
can you show the relevant code?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:emviruena
ID: 22863095
The list is result of a query, they are almost 1000 items.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22863170
>they are almost 1000 items.

well, that's 2 problems at once.
first of all, that WILL take some time to be loaded: in total 20K items...

secondly, and that's the primary problem: as a user, I would HATE software that let's me choose among 1000 items in a drop-down list !!!!!
much more user-friendly would be some alternative solution, like a filtering text-box, where after typing for example 1-2 characters, the combo/list will fill only those items that match that list. a popup-form would also be nice there...

anyhow, did you already check what part takes the most time, the query, the looping or the filling? what are the timings, btw?

tip: hide the combo box controls while filling, that might help a bit.
0
 

Author Comment

by:emviruena
ID: 22863293
In fact i am take some of the recomendations you are send me, at last, do you thing there is a way to clone the combobox and its items?  thanks.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 22863324
>do you thing there is a way to clone the combobox and its items?
none that I am aware of...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now