By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,948 Members | 1,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,948 IT Pros & Developers. It's quick & easy.

Which is best? Multi-Value ComboBox or Check Boxes?

P: 7
I'm doing a drawing register for generator control systems and have a Multi-value combo-box for the extras.

The first register I did had check boxes, but I didn't foresee the amount of extras that would come my way, so I went down the MVF Combo route which allowed me to enter as many extras as possible without the form looking like Swiss Cheese!

However, if I want to create a type of bill of materials, I can't find out how to extract one piece of text from the many possibilities of extras. For instance, If the extras include "Battery Charger, Coolant Heater, Fire Valve" - which is how it is shown in a text box in my table - how can I extract the Battery Charger option so that it shows "Battery Charger 12 Volts 5 Amps" on a separate form? If it was a check box, it would be easy.

The drawing can be used for several different types of battery charger output, which stops me putting voltage and current output on the extras list, and I can code those into the materials based on engine type and size anyway.

And no, I didn't use autonumber as the primary key for the extras, just used the name.

Attached Images
File Type: jpg MVF.jpg (43.3 KB, 418 views)
Nov 1 '13 #1
Share this Question
Share on Google+
3 Replies

Seth Schrock
Expert 2.5K+
P: 2,941
I'll admit that I'm not sure that I totally understand the question, but my recommendation would be to have all your extras in a related table (displayed in a subform). You can then either use combo boxes to select the extras (each extra selected would then be in its own record) or you can have the related table have your checkbox field showing all of the extras and you then just select the proper ones. Either way, each extra would have its own record in the related table. This makes it easy to select a specific extra as you aren't having to pull it out of a whole group of extras.
Nov 2 '13 #2

Expert 5K+
P: 8,638
It is not exactly intuitive how to extract Values from a Multi-Value Field. Let's assume you have a Table named tblContacts with a PK of [ContactID] and a Multi-Value Field named [ContactType]. Executing the following Code will list all IDs for the first 10 Records along with the Multiple Values for Contact Type, should that be the case.
Expand|Select|Wrap|Line Numbers
  1. 'An example of listing all the Complex Values in the Contacts table
  2. Dim db As DAO.Database
  3. Dim rst As DAO.Recordset
  4. Dim rstComplex As DAO.Recordset2
  6. Set db = CurrentDb
  7. Set rst = db.OpenRecordset("SELECT * FROM tblContacts")
  9. Do Until rst.EOF
  10.   'Get the Contact Type complex field
  11.   Set rstComplex = rst!ContactType.Value
  13.   Do Until rstComplex.EOF
  14.     'Dump out each value
  15.      Debug.Print "Contact ID: " & rst!ContactID & " | " & "Contact Type: " & rstComplex!Value
  16.        rstComplex.MoveNext
  17.   Loop
  18.     rst.MoveNext
  19. Loop
OUTPUT for Contact IDs 1 to 10:
Expand|Select|Wrap|Line Numbers
  1. Contact ID: 1 | Contact Type: Customer
  2. Contact ID: 1 | Contact Type: Sales prospect
  3. Contact ID: 2 | Contact Type: Customer
  4. Contact ID: 3 | Contact Type: Customer
  5. Contact ID: 3 | Contact Type: Distributor
  6. Contact ID: 3 | Contact Type: Sales prospect
  7. Contact ID: 3 | Contact Type: Trainer
  8. Contact ID: 4 | Contact Type: Customer
  9. Contact ID: 4 | Contact Type: Sales prospect
  10. Contact ID: 4 | Contact Type: Trainer
  11. Contact ID: 5 | Contact Type: Customer
  12. Contact ID: 6 | Contact Type: Customer
  13. Contact ID: 6 | Contact Type: Other
  14. Contact ID: 6 | Contact Type: Sales prospect
  15. Contact ID: 6 | Contact Type: Trainer
  16. Contact ID: 7 | Contact Type: Customer
  17. Contact ID: 7 | Contact Type: Distributor
  18. Contact ID: 7 | Contact Type: Sales prospect
  19. Contact ID: 8 | Contact Type: Customer
  20. Contact ID: 9 | Contact Type: Customer
  21. Contact ID: 9 | Contact Type: Trainer
  22. Contact ID: 10 | Contact Type: Customer
Nov 2 '13 #3

P: 7
Thanks for the above. I'm beginning to think I'm in out of my depth!

My problem is that if I want to add extras to a wiring diagram register in a quick and easy manner, it's easier to do it using check boxes. However, if somebody wants a drawing doing where the extra is not included on the form, then I'd have to add it and code in design mode. By using a calculated text box, I can add it to a table and refresh the form putting that addition into the combo box. By sending the selected additions to a text box, I can then get a write-up of what the drawing includes. Also, I can type in the extra item in the search box and it will scroll through all the drawings that include that item.

What I'd like to do is to use the drawing number as a model number for an item, and add the current rating to differentiate with sizes, as that is the determining factor (the drawing could be used for 30 or so different sizes). GS10-001-40, GS10-001-100, GS10-001-250 etc.

I'd like to extract the extras from the Drawing Additions filed so that it automatically itemises them in a BOM.

I'm not averse to trying different options, and I'll have a crack at the couple above. I just don't understand it at the moment. I've cracked a lot of other stuff (many-to-many, hiding forms depending upon whoever logs in, etc) but this one has me well and truly stumped!
Nov 6 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.