I'm hoping someone can help me figure out how to set the row source and control source of a list box so that it displays records from another table that are related to the record currently being displayed in a form.
I am a relational-database newbie, so this is very much a nontrivial task for me. I scoured Google for solutions, and I was able to get a subform to do more or less what I want. But the subform has a clunky interface for what I'm trying to do. (I was also able to very easily accomplish what I want using a combo box and a multivalued/lookup field, but I've seen people bashing these on Access forums.)
I've attached a sample database that's set up the way I think I'm going to structure my actual database. The goal is to keep track of all the orders issued by a government agency (these are orders in the legal sense, not product orders). Each order will be assigned to one or more staff attorneys in my department. Here's how I set up the tables and relationships:
I have a table called Orders, a table called Attorneys, and a junction table called Assignments. I have established a many-to-many relationship between Orders and Attorneys via the Assignments table. That is, one or more attorneys can be assigned to work on each order, and each attorney will work on many orders.
I have a form Orders based on the Orders table, and what I want to do is place a list box on it that allows the user to add/change the attorneys assigned to that order. Better yet would be using a multiselect combo box, the way I was able to do when I used a lookup field. But I think I've read that combo boxes can't do multiselect except with lookup fields.
If you open the attached database file, you'll see the Orders form containing the subform that does more or less what I want. Next to the subform is a list box with a row source based on the Attorneys table and the control source left blank. I want the list box control to select the names of any attorneys who are associated with the current order (which has to require some reference to the Assignments table) and allow the user to change the selections. Beyond that I'm pretty lost.
Thanks for any assistance you can provide!
TestDB.accdb