Hello everyone.
First time poster here. I am running into an issue with a continuous subform on one of my forms in Access. The continuous subform is based off of a query and I just dragged and dropped it into my main form. So I let Access link the Master and Child fields together. So here comes the issue. This form is for entering a new record. So the form opens to a new blank record. I want to type data into the subform first, so I type in my data and it goes to the next record in the continuous subform. So I can continue to enter more records, or finish there. So then I click onto the main form to enter more data to complete the final record. But the second I start typing data into the main form, the data in the subform clears and saves to the table related to the subform without an ID link to the main record. So when browsing through my main records, the subform data does not show up since there is not a number in the table of the subform to link to the main form. Now what I have noticed is if I enter data into the main form first and then enter data into the subform, it works correctly and the link is established. So I left my ID numbers on my form so I could see what is going on behind the scenes, and this is what I have come up with. When typing data into the subform first, it does not create a primary key number in the main table, just its own table. So once data is typed into the main form, a primary key number is generated, it clears and save the data in the subform without a linking foreign key. So I need my form to generate the primary key once I start typing in the subform so it can save the foreign key in the subform table before I start typing into the main form.
I really hope that makes sense. I have searched on this answer all over and I cannot seem to find anything exactly like my issue. Looking forward see what to community has to say. Thanks everyone!