Results 1 to 4 of 4
  1. #1
    Bkper087 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2014
    Posts
    81

    Help trouble shooting a related records issue

    I am creating a donations tracking database. I have a master table that is populated from an excel file generated by our internal systems. I cannot change this file. I have a second table that is serving as an extension of the first table in which I can enter pertinent information when new donations are received. This ultimately will allow me to track what I have processed vs. what is in my organization’s database. I really want to keep these tables separate so I can in theory update the primary table without sacrificing the information in the related.

    I have created a form that is populated a query of the two previous tables. They are related enforcing referential integrity/ cascade delete/ Join all from the Primary Table and only include the related table information that matches. I have a sub-form that includes the data in secondary table. The sub-form and master form are linked using the ID field per the properties table.

    I have an after insert macro created that inserts a table in the secondary table every time a new record is created.

    The issue I am having results when I attempt to create a new record in the form window. I can enter a name in the primary table form and save okay. However, if I attempt to enter information in the sub-table I get the error, “You cannot change or add a record because a related record is required in the [primary table]”



    Any ideas of what’s going on?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Are you sure the main record is committed to table before entering related record?

    Are the Master/Child Links properties set to appropriate PK/FK fields?
    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.

  3. #3
    Bkper087 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2014
    Posts
    81
    I assume committing the main record to the table is saving the form? I have been doing that prior to moving to the sub form.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Saving the form or do you mean saving the record?

    With bound forms and proper form/subform arrangement, no code should be required. So I really don't understand what purpose the macro serves.
    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: 5
    Last Post: 01-08-2015, 02:08 PM
  2. Replies: 3
    Last Post: 03-22-2014, 04:32 PM
  3. Replies: 10
    Last Post: 10-10-2012, 11:15 PM
  4. query won't display records with no related records
    By James Brazill in forum Queries
    Replies: 1
    Last Post: 06-28-2011, 02:10 AM
  5. Replies: 3
    Last Post: 08-10-2010, 02:12 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