Results 1 to 5 of 5
  1. #1
    astange is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2017
    Location
    Houston, Texas
    Posts
    13

    How do I get a foreign key field in one table get autofilled with the primary key in another table


    i am trying to get the foreign key field in my join table autofilled with the primary key field in my WB table
    [IMG]file:///C:\Users\astange\AppData\Local\Temp\msohtmlclip1\0 1\clip_image001.png[/IMG]

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This would need to be a form/subform arrangement where the field you want autofilled is in the Link properties of the subform.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    yes, in the subform properties ,set them to the key field:
    LINK MASTER FIELDS: ClientID
    LINK CHILD FIELDS: ClientID

    this will fill in the ID automatically.

  4. #4
    astange is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2017
    Location
    Houston, Texas
    Posts
    13
    I would need some help creating this form etc

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Create a form using the wizard for your main table, the "one" side of the join. Get this form working the way you want to handle the records in that table - adding, updating, searching, etc.

    Then create a form for the WB table, usually a tabular or continuous form. Close and save it. Then select the subform icon in the Design of the first form, a wizard will come up asking you which field(s) you want to join on. That will fill in the Link properties for you.

    Now when you are viewing a record on the main form, its corresponding records will be displayed in the subform. And when you add a new record on the subform the key field (link field) will automatically be filled in.

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

Similar Threads

  1. Replies: 8
    Last Post: 05-12-2017, 01:10 PM
  2. Replies: 2
    Last Post: 04-13-2017, 03:00 PM
  3. Replies: 5
    Last Post: 09-09-2014, 01:39 AM
  4. Replies: 11
    Last Post: 06-11-2012, 12:23 AM
  5. Replies: 4
    Last Post: 05-11-2011, 03:06 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