Results 1 to 8 of 8
  1. #1
    tabbycat1234 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    26

    Error

    I revised a program. I have the main form then have have tabs that are related to that form with a one to on relationship.

    I can enter information on the main page and the program will accept it just fine but when I go on into the other tabs to enter information that is linked to the main screen I keep getting this error.

    "You cannot add or change a record because a related record is required in table 'main information'



    Can someone please tell me what is going on.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Make sure that you don't have the table that your subform is updating in the recordsource of the main form and don't have the mainform's table in the recordsource of the subform.

    And if that doesn't take care of it, make sure you have your relationships set properly (if necessary, post a screenshot of your relationships here - upload it here, not some photo sharing site on the web as those are blocked by my workplace, as well as for other people).

  3. #3
    tabbycat1234 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    26

    Pictures

    Here is a screen shot of the relationships and a screen shot of the tabs that I have set up under my form.

    Please let me know if I can post anything else that will help resolve this issue.

    Thank You

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    1. Why do you have system tables in your relationships? They should NOT be there. Unlink them and delete them from your relationships.

    2. I see a link going down to a table which is not visible. So, delete the system tables (the ones that start with MSys) and then move things around so they are visible.

    3. What is the record source for your main form? So, I am assuming that the main form has the table MainInformation as the record source and then you have SubForms for each of the other tabs which are based on an individual table. Is that correct?

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Hah I was just in the process of writing that exact thing mr larson.

    I suspect that the subforms on the tabs are not correctly linked to the parent (main information) table so that when you try to add a record it's trying to enforce a relationship but can't find the parent record because your subform is not correctly applying the parent PK to the child item.

  6. #6
    tabbycat1234 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    26

    Pictures of relationship and main form

    Here is pictures of the relationship after I deleted all the relationships in the MS files and moved things around.

    I am also posting a picture of my main screen. This is what I have everything linked to.

    Thanks

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm assuming each one of your tabs on your tabbed form is actually a subform and that each subform has, as it's data source, a different one of your tables. If that is the case, are each one of these subforms correctly linked to the datasource for the MAIN form you're working with. If it isn't whenever you try to create a new record you're going to get an error message (because you've got your relationships set up) that there is no parent ID. You have to link your MAIN form to all your SUBFORMS correctly or you're going to orphan a lot of data at the worst or not be able to add any data at all.

  8. #8
    tabbycat1234 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    26

    Relationships

    Is there a good tutorial that I can view to make sure that I have my parent child relationship set up properly

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

Similar Threads

  1. Error 2501 displays with Error handling
    By agent- in forum Programming
    Replies: 13
    Last Post: 08-05-2011, 02:20 PM
  2. Error 3464 Reserved Error
    By e.badin in forum Reports
    Replies: 6
    Last Post: 07-18-2011, 02:47 PM
  3. Error 13 Type Mismatch error
    By GlennBurg in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 03:05 AM
  4. Replies: 8
    Last Post: 05-16-2011, 06:01 PM
  5. Replies: 2
    Last Post: 12-02-2010, 02:35 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