I have built a simple database posted here (Access 2007 format): http://www.derekbeck.com/Database1.accdb
I have two tables:
- a task list
- an organization list
I want a form “assign orgs” to have a dropdown list drawing from the org list table, which I have done. I have it set to show several things in the dropdown list: the org name and the org type. For example, the drop down list shows these two columns:
airline | American Airlines
airline | United Airlines
eCommerce | ebay
eCommerce | Amazon
if one looks in the table “org list” you’ll see it set up this way:
ID org type org name website
1 airline American Airlines www.aa.com
2 airline United Airlines www.ual.com
The reason I am doing this two columns of data is because the list is going to be really long, and having them sorted by org type first than alphabetized second is helpful for data entry. (The database and tables I am using for the purposes of this question are hypothetical.)
So here’s the trouble: when one selects from my dropdown box on my form “assign orgs”, which basically steps through the “task list” table and allows data entry based on the “org list”, you get, as I said above, the following:
airline | American Airlines
airline | United Airlines
eCommerce | ebay
eCommerce | Amazon
If you select, say, the first line, the result on the form is “airline”.
* My first question is: how do I have it render in the populated form the second column shown (really the third column of the table): that is, how do I have it render “American Airlines”?
Next, if you go to the raw table view of “task list”, and look at the newly populated “org assigned” field, you don’t see “airline” nor “American Airlines” but the ID number corresponding to it, say “1” in the case above.
* My second question: how do I have it show “American Airlines” in the table’s raw data field, not the ID number?
Finally, I’ve read a bit on relationships, and connected the “org assigned” field in the “task list” table to “org name” field in the “org list” table, but I’m not sure if this is correct. In fact, I’m not sure what to do, if anything, about assigning a relationship.
* Last question: how do relationships work for this problem here? Do I need them? How should I set them up if so?
PS: The exact order of the table examples I give above do not match the example database I built.
Question 1 & 2
the row source should include both the ID and the orgName as outputs
set Bound Column property to 1
set Column widths property to 0cm;2.5cm
question 3
the task list table will/should have a field called OrgId that is a foreign key to the Organisation table. This is how relationships work, on the TaskList form there should be a combo box that is bound to the OrgId field, its row source is the Organisations table with the properties indicated above. The combo box wizard will step you through setting it up, even if you already have a combo box on there, put another one on to step through the wizard and look at the properties.