[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

listbox multi select property in access

Wish to add a list in the Form whereby I can make multiple choices. I've added a table (Bakterien) from which one or more bacteria can be chosen as the source of an  infection. Somehow I can get the list box to communicate with the table in such a way that I can make multiple choices.
SSI-1-.Cardio.mdb
0
sevarg
Asked:
sevarg
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You would have to store those choices in another table, and use a subform to do this ... base the subform on the table that stores the items chosen (and include the primary key of the related table as well). Storing multpile values in a table field violates normalization rules.
0
 
Jeffrey CoachmanCommented:
Yes, since one Bakterien can cause more than one infection you need a "Child" (Many)  Table.

However, If One Infection can be associated with more than one Bakterien, then you will need a Many-To-Many Table instead

---One To Many---
tblInfection
InfectionID (Primary Key)
InfectionName
InfectionType
InfectionDate

tblBakterien
BakterienID (Primary Key)
InfectionID (Foreign Key)
BakterienName
BakterienCategory
(These two tables would be linked on the common Field (Infection ID)

---Many To Many--
tblInfection
InfectionID (Primary Key)
InfectionName
InfectionType
InfectionDate

tblBakterien
BakterienID (Primary Key)
BakterienName
BakterienCategory

tblInfectionBakterien
InfectionBakterienID (Primary Key)
InfectionID (Foreign Key)
BakterienID (Foreign Key)

(These three tables would be joined on thire respective Keys as well)

See and study the northwind sample database for an example of both scenarios.
http://www.microsoft.com/downloads/details.aspx?familyid=C6661372-8DBE-422B-8676-C632D66C529C&displaylang=en

See these links on creating a multiselect Listboxes.
For a query
http://www.mvps.org/access/forms/frm0007.htm
For a Report.
http://www.mvps.org/access/reports/rpt0005.htm

;-)

JeffCoachman




0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now