Results 1 to 7 of 7
  1. #1
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52

    Primary ID not showing automatically in Child table

    Hello,



    I have an employee table(parent) and family (child)members table. I have a field in the Family table called employee which i have created the one(employee) to many (family relationship). When I add a new family member why does the employee id not show automatically show in family table. I have to add it manually.

    Thanks

    RossClick image for larger version. 

Name:	DB3.JPG 
Views:	13 
Size:	24.6 KB 
ID:	21227

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    ask yourself this - if your employee table has more than one record - how does access know which one to choose?

    To autocomplete this field you need to give access a clue - and you do this by using forms, not by direct entry into a table.

    Create a form for employees and another form for families - then insert the family form into your employee form as a subform. If you have set your relationships correctly, Access will complete the linkchild and link master properties for the subform otherwise Access will prompt for them. This is how you give access a clue

    Note when creating the employee form, create as a single form and when creating the family form, create as a continuous or datasheet form

  3. #3
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52
    On an another note, will the same work for linked forms?

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Note sure what you mean by linked forms - if you mean two separate forms where you open one form from the other or both are open at the same time then it can be done with coding - what that coding is and where it goes depends on how that all works

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    ross,

    Ajax has given you good info regarding populating related tables. Don't do data entry directly with tables.
    It seems to me that you may be struggling with some database concepts.
    A few things to consider:
    - get a clear description on what you are trying to do
    - work through this tutorial to design a database to support what you are trying to do
    - get some test data to test your evolving data model
    (getting your tables and relationships set up to meet your requirements is critical to database)
    - watch some youtube videos on Access tables, queries, forms... to see how others use Access
    - here are videos by Steve Bishop who is a member of this forum

    Good luck.

  6. #6
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52
    Thanks all for your help. I understand how most of it all works.(I think). Just been playing around with the design and sometimes I come up against something which doesn't work which doesn't make sense to me if the relationships are correct. Will take a look.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Give the tutorials an honest effort. Post back if you have specific issues/questions.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-11-2014, 11:25 AM
  2. Replies: 3
    Last Post: 01-15-2014, 10:39 PM
  3. Get last ID of primary key automatically generated
    By California2013 in forum Access
    Replies: 1
    Last Post: 09-12-2013, 05:57 AM
  4. Replies: 3
    Last Post: 07-10-2013, 08:54 AM
  5. Replies: 3
    Last Post: 12-12-2012, 01:13 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