Results 1 to 5 of 5
  1. #1
    Cris is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    3

    Sub forms and Tab control primary key help

    I am a school student working on a Microsoft accessdatabase, and have little experience in the software.
    I have created an input form for students to enter theirinformation using sub forms and tab controls. I have 5 separate tables thatrecord specific data: student details, contact details etc. From these I maderelated forms. In my combined student input from, each tab in the tab control hasa sub form from these individual table forms. After inputting all of my data, Iopened the related tables and realised that the primary key used by all thesetables/forms was only being recorded from the first tab (student details). Inthe other tables/forms (contact details etc.) a primary key for that record isgiven from that table's ID, but not the relating foreign key.
    When I created the sub forms I linked them through thewizard with this primary key, however, it does not record in my tables. When Icreated the blank from my initial record source was the Student Details tables,however I’m not sure if this has something to do with the problem. Is there a method to either fix or work around this issue?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Do you really need 5 tables?

    Why are student details and contact details in separate tables? Student has multiple contacts (addresses, phones, emails)?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    Cris is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    3
    I guess I have many tables in order to improve clarity, also note that some of these tables are for processing orders. The tables for the forma are: Student details, Contact Details, Medical Details, Order Details, and travel details. Even if I merged the
    Student details, Contact Details, Medical Details and Travel Details tables. I still need separate tables for the orders and products. I believe my problem is in the linking of the primary key with the subforms. Do you have a solution?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Without more info on data relationships, first impression is need a main form bound to StudentDetails then subforms bound to each of the dependent tables. Set Master/Child Links properties so the StudentID will save as foreign key to each of the dependent tables.
    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.

  5. #5
    Cris is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    3
    What I did was link the main form to the Student Details tables, then create the other subforms, linking via the studentID.

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

Similar Threads

  1. Replies: 4
    Last Post: 08-10-2017, 12:56 AM
  2. Replies: 4
    Last Post: 08-05-2017, 01:15 AM
  3. Primary Keys for Tables & Forms
    By Tantum4 in forum Access
    Replies: 9
    Last Post: 02-04-2015, 06:07 AM
  4. Replies: 5
    Last Post: 01-16-2013, 03:48 PM
  5. Replies: 1
    Last Post: 10-26-2012, 03:27 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