Results 1 to 5 of 5
  1. #1
    DigitalAdrenaline is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2012
    Posts
    100

    Related Record Issue

    Hi Guys, I've created a library database and when I add a new publisher name to tblPublisher and refresh my primary data entry form, the following error appears (see screenshot),


    'You cannot add or change a record because a related record is required in tblCentury'.
    Following this when I hit my Refresh macro button (on the main form), I get the additional dialogue box: 'Stop All Macros'.
    When I then close-reopen the database, I'm then able to then see the added Publisher from the drop-down combo box list. Just wondering if anyone might have a suggestion how to fix this bug. Am happy to provide further screenshots to assist. Thanks.

    Click image for larger version. 

Name:	Access Issue 3.jpg 
Views:	13 
Size:	106.7 KB 
ID:	34798

    Click image for larger version. 

Name:	Access Issue 1.jpg 
Views:	12 
Size:	64.8 KB 
ID:	34796

    Click image for larger version. 

Name:	Access Issue 2.jpg 
Views:	13 
Size:	24.7 KB 
ID:	34797

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Are you using combobox NotInList event? Post code or provide db.
    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
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Your code is causing the record to attempt to save, and it can't because of the referential integrity violation.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    DigitalAdrenaline is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2012
    Posts
    100
    Hi guys, solved the issue. Per the screenshot below, I'd not set the 'Lookup' Tab to be consistent with the other tables. As soon as I corrected the info, all works fine now. The display Control was set to 'Text' rather than Combo Box, and the Row Source not set to tblCentury. The Refresh now works instantly. Thanks guys.
    Click image for larger version. 

Name:	Access Issue 4.jpg 
Views:	12 
Size:	48.4 KB 
ID:	34799

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you solved it. Most of us won't use that "feature":

    http://www.theaccessweb.com/lookupfields.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 17
    Last Post: 01-25-2018, 08:03 PM
  2. Replies: 15
    Last Post: 03-05-2015, 03:30 PM
  3. Help trouble shooting a related records issue
    By Bkper087 in forum Access
    Replies: 3
    Last Post: 02-25-2015, 03:18 PM
  4. Replies: 40
    Last Post: 08-20-2013, 11:38 PM
  5. Replies: 7
    Last Post: 07-02-2012, 10:50 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