Results 1 to 5 of 5
  1. #1
    FredoC is offline Novice
    Windows 11 Access 2016
    Join Date
    Oct 2025
    Posts
    1

    Variable number of entries in a field


    Hello, I am trying to make a nice database for my board game collection, with the name, publisher, year published, # of players etc... One of the entry will be the designer. Many games have just one, but some have 2, or more. I could use a Multivalued field, but I read it is discouraged by database normalization principles. From what I read, having a subform with many-to-many relationships would be the way to go, but I am not exactly sure about how to implement in my case, even though I feel like it is a fairly simple (or not too uncommon) situation. Anyone can help?

    Frederic

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Yes, multi-value field is not preferred by experienced programmers but if you fully understand its drawbacks and how to deal with, it might be appropriate for your needs. Otherwise, have a related table where each selected developer is a record (this is actually what MVF does but table is hidden). Many-to-many actually involves 3 tables. Form arrangement would be main form bound to Games table and a subform bound to GameDevelopers table with a combobox for selection of developer from Developers table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Office 365
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    A multi value field still has the many to many table, it’s just that it is hidden and limited in structure- basically just containing the PK of the parent and the PK of the child.

    On many occasions you want more than that - for example the date a relationship started or ended (employer/employee, customer/contact), or perhaps a quantity or type of relationship such as job role.

  5. #5
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Hello, I am trying to make a nice database for my board game collection, with the name, publisher, year published, # of players etc... One of the entry will be the designer.

    BoardGame(GameID autonumber PRIMARY KEY, Game Title TEXT(25) NOT NULL, Publisher TEXT(50) NOT NULL, YearPublished INT NOT NULL)

    Designer(DesignerID
    autonumber PRIMARY KEY, FirstName TEXT(25) NOT NULL, LastName TEXT(25) NOT NULL)

    GameDesigner(DesignerID INT NOT NULL, GameID INT NOT NULL);

    It's actually easier to do this in T-SQL because you can name and specify the foreign keys more cleanly.

    CREATE TABLE GameDesigner (
    DesignerID INT,
    GameID INT,
    CONSTRAINT pkGameDesigner PRIMARY KEY (DesignerID, GameID),
    fkDesigner FOREIGN KEY DesignerID REFERENCES Designer(DesignerID),
    fkGame FOREIGN KEY GameID REFERENCES Game(GameID)
    );



Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 08-02-2021, 08:17 AM
  2. Replies: 3
    Last Post: 09-26-2017, 11:19 PM
  3. Replies: 2
    Last Post: 05-07-2015, 02:55 PM
  4. Using BETWEEN in variable entries
    By jtmurphy in forum Queries
    Replies: 3
    Last Post: 07-25-2014, 10:46 AM
  5. Replies: 11
    Last Post: 03-13-2014, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums