Results 1 to 3 of 3
  1. #1
    gsc is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8

    Relationship between Main form and Subform


    I am relatively new to Access and have produced a database that has a main form with ID (primary key) names and addresses and a subform that shows the Exam reference (primary key) and date with morning and afternoon, yes/no fields, for when someone is available. The probelm is I cannot get the relationship to link the subform with an individual person in the main form. When I click in a date morning field it does this for every record in the main form. I am sure there is a very simple explanation but I am at a loss as to the answer.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You have to have a Field in common between the Table behind the Main Form and the Table behind the Subform. So you need to add a Field to your Subform Table that matches the ID Field in your Main Table. This Field will be a Foreign Key in the Subform Table. Then you select the Subform Control (not the Form but the Subform Control itself) then go to Properties - Data and fill in the names of these Fields in the the Link Master Fields and Link Child Fields. The Form and Subform should now be linked.

    Linq ;0)>

  3. #3
    gsc is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    8

    Relationships between main form and subform

    Quote Originally Posted by Missinglinq View Post
    You have to have a Field in common between the Table behind the Main Form and the Table behind the Subform. So you need to add a Field to your Subform Table that matches the ID Field in your Main Table. This Field will be a Foreign Key in the Subform Table. Then you select the Subform Control (not the Form but the Subform Control itself) then go to Properties - Data and fill in the names of these Fields in the the Link Master Fields and Link Child Fields. The Form and Subform should now be linked.

    Linq ;0)>
    Thank you, have done this and it worked but lost the dates from the subform but I think I can work around this so it doesn't matter.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  2. Form and Subform relationship
    By ZJGMoparman in forum Forms
    Replies: 1
    Last Post: 04-16-2012, 12:25 AM
  3. Form/Subform relationship help
    By bkirsch in forum Forms
    Replies: 13
    Last Post: 01-27-2012, 01:24 PM
  4. Form/Subform relationship
    By justhininabouti in forum Forms
    Replies: 2
    Last Post: 11-28-2011, 09:07 PM
  5. Replies: 0
    Last Post: 02-16-2006, 09:11 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