473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to build a combo box with 1300+ options?

Hi All!

I'm a returning novice working on building a database to house Hospital Acquired Infections. I'm seeking advice on how to build a combo box with a list of over 1,300 pathogens. There are three fields on a form requesting Pathogen identification and as it stands I have 1,300 + pathogens to chose from. Is a combo box an appropriate way to do this? I have the pathogens in an excel spread sheet and in a word document.

How do the experts suggest to do this?

Many thanks!
Jun 3 '10 #1

✓ answered by NeoPa

I would start with the design of the table. If you have an AutoNumber field in there (called [ID] or such like) then any data imported will also be associated immediately with an ID.

I'm afraid I don't have a very clear understanding of what you're attempting on your form. If you simply want a bound ComboBox that shows the pathogen name but stores the associated ID then, assuming the ID field is first, use Column Count = 2, Column Widths = 0;2 and Bound Column = 1.

PS. Step 4 threw me somewhat, as it's a question.
It is not necessary, though in some circumstances it may be advisable, to create a relationship between the tables.

13 1575
patjones
931 Expert 512MB
Hi,

I have used combo boxes with this many items, but in those situations the user will start typing in what they want and have Access pick out the value as it is being typed. Scrolling through the actual list with this many items is possible but not practical.

You can import the Excel sheet into the database, and have a table that holds the pathogen list. Then you'll make the table the combo box record source.

Ideally how you would set this up is to have an ID number for each pathogen, and then the pathogen name. When you bind the combo box to the table, you'll have two columns (one for ID and one for name)...but set the column widths to 0" and 2" for instance, so as to make the ID column disappear (it will still be a part of the combo box, just not visible).

By setting the bound column property to 1 (the ID), selecting something from the combo box will cause the ID number to be stored in the record rather than the actual pathogen name. This is the clean approach that will prevent pathogen names from getting duplicated record after record.

Pat
Jun 3 '10 #2
@zepphead80
Thanks Pat!

In the interim I asked the question, I figured out how to put to use your advice and it's working minus the ID field.

Question for you: The information we will be storing concerning pathogens is intended to be exported to a CDC reporting database, where the actual pathogen name is used. Should I go ahead as you suggested and create an ID field. If so, what do you mean by ID a number or abbreviation (e.g, Adenovirus=ADV)?

Much thanks for your help, it was crystal clear!
Jun 3 '10 #3
NeoPa
32,556 Expert Mod 16PB
It's good that you're making progress without the need for hand-holding.

In answer to your specific questions :
  1. Yes. Use an ID field in place of duplicating text around the place. It is better on many levels.
  2. Use an AutoNumber field in place of anything else. With that number of records particularly, you don't want to be left with the job of assigning matching abbreviations to each record. If you had pre-existing, unique, abbreviations that could work, but generally AutoNumber is used for such situations.
Welcome to Bytes!
Jun 3 '10 #4
patjones
931 Expert 512MB
I'm happy that it works for you.

As NeoPa suggests you can just AutoNumber the IDs. When you go to export the records for CDC reporting purposes, you can build a simple query to look up the ID in your pathogens table and pull the actual name.

Pat
Jun 3 '10 #5
Friends,

Sorry, but I'm having troubles executing the Auto Number suggestion.

I imported the Pathogen List to TblPaths from excel and then created a RecordID (Auto Number). However, when I input the pathogen into the form, the field in the table reads the entire path name.

I typed column widths 0";2" initially, but was unable to read my path list from the drop down box in the form, so switched it to 2";0" with no luck.

What am I doing wrong?

Are these the appropriate steps to follow?

Step 1: Import Pathogens into Table

Step 2: Add RecordID field (Autonumber) to Table

Step 3: Go in design view of existing form and change pathogen control source, column widths 0"2",ensure column bound property=1, and then press save.

Step 4: Do I need to create relationship with Pathogen table and the table I want the values to be entered into?
Jun 3 '10 #6
NeoPa
32,556 Expert Mod 16PB
I would start with the design of the table. If you have an AutoNumber field in there (called [ID] or such like) then any data imported will also be associated immediately with an ID.

I'm afraid I don't have a very clear understanding of what you're attempting on your form. If you simply want a bound ComboBox that shows the pathogen name but stores the associated ID then, assuming the ID field is first, use Column Count = 2, Column Widths = 0;2 and Bound Column = 1.

PS. Step 4 threw me somewhat, as it's a question.
It is not necessary, though in some circumstances it may be advisable, to create a relationship between the tables.
Jun 3 '10 #7
patjones
931 Expert 512MB
@davisjr6
You could just assign the IDs in Excel by inserting a column next to the pathogen names and then numbering the rows one through 1300. This way all you will need to do is the import and you'll be set.

When the table is imported, you should still set the ID column to AutoNumber so that any future additions to the table are numbered according to what is there already.

Pat
Jun 3 '10 #8
Perfect! It works now!!!

Thanks a mil to you both (NeoPa and Pat)!!!
Jun 3 '10 #9
NeoPa
32,556 Expert Mod 16PB
I don't believe that will work Pat. You get the error :
Once you enter data in a table, you can't change the data type of any field to AutoNumber, even if you haven't yet added data to that field.
Jun 3 '10 #10
patjones
931 Expert 512MB
@NeoPa
Yikes. I had a feeling I was jumping the gun. I very rarely use AutoNumber and shouldn't have made that assumption.
Jun 3 '10 #11
@NeoPa
That's true. I just created the ID field (AutoNumber) and it worked like a dream.

Thanks again!
Jun 3 '10 #12
@NeoPa
Just a quick thought:

Say the IP Nurse enters a pathogen that is not in the list, will a number be automatically assigned to it? How will the data from that field be recorded.

Given the nature of this field, these Pathogens are likely to change often. I just wanted to make sure that I've accounted for such a possibility.

THANKS!
Jun 3 '10 #13
NeoPa
32,556 Expert Mod 16PB
That is not handled automatically, no.

There are ways to do so though. You may even find some discussed in this forum if you look. Otherwise, I suggest you give some thought first to exactly what you want to happen and exactly how it should present, then post a separate thread on that topic.
Jun 3 '10 #14

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

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
3
by: joni b | last post by:
I need help limiting the options shown in a combo box. I have two combo boxes that appear in a datasheet view subform. The form looks like an Excel spreadsheet, which is what the user prefers....
1
by: Starwood | last post by:
I have an existing table with two fields in it (Code and Description) that I want to use to fill a field in a new database using a combo box on an Input Form. I would like the user to see the...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
6
by: Mickster | last post by:
Hi there I am currently making a sub form. The form will have a combo box and a option group. The combo box contains a list of four employees. The option group has to radio buttons labeled Active and...
4
by: Miguel | last post by:
I have an order entry database with two forms. One is for new orders the other is to update orders. The forms are identical except that one is strictly order entry. On both forms are three sets of...
5
by: consonanza | last post by:
I am working on a report filter form. It has 2 combo boxes (cmboSelectSubject and cmboSelectCategory) to select criteria. Selecting an entry in combo 1 restricts the options available in combo 2....
3
by: annoir | last post by:
I am trying to create a stored procedure using the DB2 Connect Development Center. I am able to create the project, connect to the remote database on the mainframe and create the stored procedure....
3
by: dufnobles via AccessMonster.com | last post by:
I have a form that displays a dropdown box. The options in the drop down vary according to a value queried from a database boolean (Yes/No) field. I would like to do the following: If the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.