Results 1 to 9 of 9
  1. #1
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202

    Primary key not transferring to FK on subform?

    For some reason when I add records to a subform the master field ID from the parent form does not transfer to the subform and add it to the table?



    Main form PK: EmployeeID
    Subform FK: EmployeeID

    After I add events on the subform, the FK doesn't populate at all and when you go back to the record the items you have entered are gone. When you check the table, the entries are there, just missing the EmployeeID field?

    I know it's something simple that I am overlooking, any help is greatly appreciated. Thanks.

    On the subform, Link Master Fields and Link Child Fields are both set to EmployeeID.

  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    You're on an active record on the main form? Be sure to include the EmployeeID field on both the main form and subform. For testing purposes, make sure they're visible on both forms.

    I can't see your problem happening if your master/child fields are set. I would also set the EmployeeID field as 'required' in the events table....so you don't get orphans.

  3. #3
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Ok this is too strange. I did your suggestions. Initially I had the ID's on both forms hidden. I made them visible, then made the subforms table ID field required.

    Now when I try and add data on the subform and tab away, it now gives me an error that I haven't set a required field EmployeeID, as it is still not xfering the key....

    This boggles the mind.

  4. #4
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Feel free to have a look.... (frmEmployees)

  5. #5
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I deleted the subform....then added a new one. It worked fine from that point forward.

  6. #6
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Quote Originally Posted by kennejd View Post
    I deleted the subform....then added a new one. It worked fine from that point forward.
    Crazy, what do you think happened there??

  7. #7
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I think the problem is with the 'Attachments' field. I when I added that field to the subform, I had the same problem from your original post. I think it's because it's a field that can hold multiple items....and it the subform isn't sure what to do with it.

  8. #8
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    Roger that, I think you are right. I re-added it and all is working well. Suppose I should have tried that first, LOL.

  9. #9
    10 Gauge's Avatar
    10 Gauge is offline Getting the hang of it...
    Windows XP Access 2007
    Join Date
    Feb 2011
    Location
    Fredericksburg, VA
    Posts
    202
    So this is weird. This problem just started happening to me again out of the blue somehow??? What in the world....

    Edit: Nevermind.

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

Similar Threads

  1. Transferring text within quotation marks
    By Lynette in forum Access
    Replies: 6
    Last Post: 11-24-2010, 11:58 AM
  2. hyperlink data not transferring to destination table
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:12 PM
  3. Absolute beginner qu - transferring a database
    By kirstywing in forum Access
    Replies: 2
    Last Post: 09-07-2010, 02:12 AM
  4. Need help on transferring found record
    By awsmitty in forum Access
    Replies: 1
    Last Post: 01-22-2010, 09:11 PM
  5. Transferring Individual Records
    By bazillion in forum Programming
    Replies: 0
    Last Post: 01-25-2008, 12:13 PM

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