Subform not keeping data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marylipscomb
    New Member
    • Apr 2007
    • 51

    #1

    Subform not keeping data

    I keep getting an error message saying
    You cannot add or change a record because a related record is required in table


    Table A has the data in it already, the linked field is an Autonumber, and it has the number 1, when I enter data in Table B(subform, on my main form) thats when the message occurs. Why?? Help please!!

    Thank you
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I've run into this and it was because the record had not yet saved to my table.

    So when you say the table has the data, do you really mean the table? Or do you mean the form has data? Because it's two different things. You might see the information on the form but that doesn't mean it's saved to the table. What I ended up doing was saving the record through code before going to the subform.

    Comment

    • marylipscomb
      New Member
      • Apr 2007
      • 51

      #3
      Originally posted by Rabbit
      I've run into this and it was because the record had not yet saved to my table.

      So when you say the table has the data, do you really mean the table? Or do you mean the form has data? Because it's two different things. You might see the information on the form but that doesn't mean it's saved to the table. What I ended up doing was saving the record through code before going to the subform.

      When I go to the table it is there in the table and on the form. So that is why it doesn't make sense to me.
      I think I just might have to go the "code" route. Nothing seems to be working for me, and I get one problem fixed there is another one. The problem is I have no idea how to begin with code on this.

      Thanks for your help.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Not a problem, let us know if you have a problem with the coding.

        Comment

        Working...