winzip icon

a(UPDATED - July 23) A Two List Boxes ActiveX Control - It's original, useful and very instructive!

Submitted on: 1/26/2015 11:55:00 AM
By: Elias Barbosa (from psc cd)  
Level: Intermediate
User Rating: By 46 Users
Compatibility: VB 6.0
Views: 2488
     Let's say, for example, that you have a database with all your clients. Now, you want to select just a few of them and get all the information stored on the database about them. The ideal interface to solve this problem would be to have a List Box with all your clients on one side and an empty List Box on the other side. You could, then, select the clients that you wanted just by double-clicking on their name. The selected clients would move to the empty List Box. When you finished with the selections, you would be able to access a Recordset with only the clients that you selected! ____________________________________________________ Sounds good? Well, this ActiveX Control does just that! ____________________________________________________ >> If you ever tried to create an interface using two List Boxes you will truly appreciate this Control. Here is a list of the main features: ____________________________________________________ * It will connect to a password protected Database. ____________________________________________________ * The users can navigate on the Control with their keyboard. ____________________________________________________ * It will list the records according to the specified field. ____________________________________________________ * The users can select multiple items. ____________________________________________________ * A Recordset will be generated with the selected clients! ____________________________________________________ >> I worked as hard on the user interface as I did on the programmer interface. The Property Pages are very useful! ____________________________________________________ * You will be able to browse to the folder were your Database is! ____________________________________________________ * As soon as you provide a database name, the Property Page will list all Tables on a Combo Box so you can easily select a Table! ____________________________________________________ * As soon as you select the Table, the Property Page will list all the Fields from this Table on Combo Boxes so you can easily pick one Field according to the situation! ____________________________________________________ >> What you can learn from this submission: ____________________________________________________ * How to connect to a Database, a Recordset, a Table or a Query Definition. ____________________________________________________ * How to create a temporary Query Definition. ____________________________________________________ * How to create a SQL statement. ____________________________________________________ * How to sort a Recordset. ____________________________________________________ * How to list all Tables found on a Database and all Fields found on a Table! ____________________________________________________ * How to find out if a Field is a Primary Key or if it is a numeric Field! ____________________________________________________ * How to sort an array on numeric order using the "bucket sort" algorithm. ____________________________________________________ * How to sort a "two dimensional" array on alphabetical order using the "Bubble" algorithm. ____________________________________________________ * How to find the width of a string in Twips or Pixels! ____________________________________________________ * How to add a horizontal Scroll Bar to a List Box and how to find out if a List Box needs a horizontal Scroll Bar! ____________________________________________________ * This ActiveX Control comes with a nice Common Dialog Box Module! ____________________________________________________ This ActiveX Control does a few tasks that, at first glance, look very simple. However, it took me almost a month to finish it. So, please, give me your vote and post some comments. There are literally dozens of reasons to download this ActiveX Control! Go ahead and do so!!

winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net

Other 8 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

6/9/2019 4:18:05 AMRob C

A possibly simpler solution would be to have a single listbox with checkboxes, and have a 'Toggle' button to show either -
- Selected only
- All
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.