Results 1 to 3 of 3
  1. #1
    Chad Access is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2015
    Posts
    49

    Subform is not inheriting ID


    My subform (whose table is related to the parent) is not inheriting the ID of the parent. It is setup properly in terms of the parent - child linkages. It actually works fine on a subsequent form where the parent record has already been created.

    It seems as though since the parent entry is being created, it does not inherit the id, but on the next form, it is able to inherit it because the id already exists. However, I would love for it to work right off the bat.

    Hope this makes sense. Thanks for the help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you cannot enter subform children until THE PARENT IS SAVED.
    The forms will let you enter a new parent and then go into the sub form to enter BUT the parent form record has not been saved yet.
    It must be saved 1st in order to create the ID. THEN you can enter subform data.
    you may want to disable the subform (on new record entry) ,then enable it once the master record gets saved.
    then you can enter child records.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Ranman, adding a new record on the parent form then a new record in the subform works perfectly for me. Access commits the parent record when moving to the subform and the parent ID is available. Actually, the parent ID shows in the subform foreign key field on new record row as soon as I enter data into the parent form, like a default value would show.

    Would have to review the db. If you want to provide, 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.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-05-2016, 02:23 PM
  2. Replies: 1
    Last Post: 04-24-2013, 12:12 PM
  3. Replies: 4
    Last Post: 10-08-2012, 05:33 PM
  4. Replies: 6
    Last Post: 05-05-2012, 08:43 AM
  5. Replies: 4
    Last Post: 03-30-2012, 01:47 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