Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

    OK, you got this far.This is how I would design the tables.

    Click image for larger version. 

Name:	Relationships.png 
Views:	16 
Size:	38.0 KB 
ID:	44218
    Attached Files Attached Files

  2. #17
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    274
    As previously reported, the correct management of the various properties of the fields and indexes in the tables is missing, see for example:
    tblStudentMember
    properties of fields FirstName, Surname and RegistrationDate should have the Required property set to True which would not allow you to create records without data that are considered indispensable.
    table indexes
    the index ID should be deleted as it duplicates PrimaryKey with unnecessary use of space in the database
    creation of at least one unique index (example FirstName, Surname) that does not allow the creation of duplicate records (as occurred in the example posted by ssanfu (records 1 and 2 rob missing, records 3, 4 and 5 steve missing, record 6 , 7 and 8 sam missing)

  3. #18
    Join Date
    Feb 2021
    Posts
    7
    when i put foreign key in enrollemt table I can't have one to many relationship. How should I do it then?

  4. #19
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    If you inspect ssanfu's diagram you can see they had no issue creating the one-to-many relationship. Not knowing exactly what your doing there could be a couple things causing your issue.

    First, in the enrollment table make sure that the individual foreign key fields have indexes but DO ALLOW duplicates. (You do need a unique multicolumn index too but this is an entirely different index. Here's another tutorial on multicolumn indexes https://www.geeksengine.com/article/composite-unique-index-access.html )

    Second, in the relationship window drag from the primary key field from your student or trip table and to the corresponding foreign keys field in the enrollment table.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-15-2019, 07:23 AM
  2. Replies: 3
    Last Post: 08-02-2014, 09:48 PM

Tags for this Thread

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