Results 1 to 5 of 5
  1. #1
    EvanRosenlieb is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Location
    Fort Collins, CO
    Posts
    37

    Problem using Parent/Child Form/Subform

    I posted this as an addendum of a previous thread of mine but I believe it is more appropriate in this section. I am an access newbie and I'm sure there is an easy answer to this:



    The data that gets entered in the parent form shows up as a record on the parent table, and the information that gets entered into the subform gets entered as new records in the child table. However the ParentID field in the child table remains blank. I would like the ParentID field to automatically add the ParentID of the record that is being added into the child table... Surely there is a way to do this?
    Thanks,
    -Evan

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If this field is both the MasterField and the ChildField of your SubFormControl then Access will complete it for you in the SubForm.

  3. #3
    EvanRosenlieb is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Location
    Fort Collins, CO
    Posts
    37

    Thanks!

    The book I am working off of seemed to imply that if there was a relationship at the time you set up the form/subform then it would just automatically work. After manually setting these fields in the property tab, however, it worked perfectly.

    -Evan

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It sounds like the book was just a bit unclear on the subject. Glad we could help.

  5. #5
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by EvanRosenlieb View Post
    The book I am working off of seemed to imply that if there was a relationship at the time you set up the form/subform then it would just automatically work. After manually setting these fields in the property tab, however, it worked perfectly.

    -Evan
    Actually, usually it will set it up for you automatically if you choose the right option when you place the subform on the form. So, either your Wizard was disabled (magic wand button not depressed when dropping it on the main form) or perhaps your database didn't have the trusted location set or code enabled when doing it.

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

Similar Threads

  1. Parent/Child Append Question
    By davidson12 in forum Access
    Replies: 6
    Last Post: 01-15-2015, 08:15 PM
  2. Child/Parent relationship
    By ErnieS in forum Forms
    Replies: 1
    Last Post: 08-20-2010, 01:22 PM
  3. Calculation using Child and Parent
    By SamanthaSamuels in forum Reports
    Replies: 3
    Last Post: 08-17-2010, 11:07 AM
  4. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  5. Parent/Child subform
    By Jerry8989 in forum Forms
    Replies: 1
    Last Post: 09-18-2009, 07:27 AM

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