ADODB.Recordset Related record required

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RadioWriter
    New Member
    • Jun 2015
    • 12

    ADODB.Recordset Related record required

    ADODB.Recordset Related record required
    Hi all-
    I'm working on a tool that exports worksheets from Excel to Access tables. On an Update statement, I'm getting the following message: "Run-Time Error '-2147217873 (80040e2f)': You cannot add or change a record because a related record is required in table 'Customer'." But the error is thrown (apparently) at random. Not only is there no relationship with the 'Customer' table, but there is nothing in common between the lines on which the error is thrown.

    I'm not sure how much of this actually has to do with code, so I'm going to hold off on that. I'm using Access 2013, and the program is written in an Excel 2013 Macro. If there is any more information needed, please let me know and I would be happy to provide it.

    Thank you so much!
    Last edited by NeoPa; Jul 14 '15, 12:17 AM. Reason: {NeoPa} Original reinstated.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1290

    #2
    RW,
    Tell us more details. What table is being populated? What fields are being populated?

    If you can tell what row is causing the problem, try keying that row in to the target table manually. When you finish the row you may get a more detailed error message.

    Jim

    Comment

    • RadioWriter
      New Member
      • Jun 2015
      • 12

      #3
      Many apologies, Jim. The table being populated was called BOM Detail. But because of the space, the code was referencing a different table called BOM. The issue no longer occurs (added square brackets around the name). Thank you for your time, and I'm very sorry for the inconvenience.

      Comment

      • RadioWriter
        New Member
        • Jun 2015
        • 12

        #4
        Solutions Found - Assistance no longer required

        Sorry for the inconvenience-
        After posting I tried editing a few more things and found that all of my problems were caused by a space in the table name.
        Last edited by NeoPa; Jul 14 '15, 12:18 AM.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32634

          #5
          No need for apologies.

          As it happens, and for reasons I won't bore you with unless you express an interest, we prefer to keep the originals in play even when the question has been answered fully and satisfactorily.

          That you came up with your own solution is perfectly fine and we're happy that you no longer need assistance in this particular case.

          Feel free to post more questions here. Your actions indicate an attitude that we appreciate :-)

          Comment

          • RadioWriter
            New Member
            • Jun 2015
            • 12

            #6
            Not a problem. When I actually stop to think about it, it makes sense to keep the original questions in play (so others with similar problems can find the answer to whatever they've searched). I just hadn't really thought about it. ^^; I'll keep it in mind in case something similar happens in the future.

            Comment

            Working...