Sub-form records not saving - Please help :)

Marissa

New member
Local time
Yesterday, 21:29
Joined
Oct 3, 2012
Messages
1
Hi! I'm a novice MS Access user, although I have been taking Beginner classes online to learn as much as I can.

I am stuck with a problem I haven't been able to find the answer to online and would greatly appreciate and help or advice because fixing this will help make my work life so much easier!

I have a form with a subform. When I add records to the subform, the records only save while I am on the same record number of the main form. If I go to Record 2 of the main form to create a new sub form record, then I lose the changes I made when I scroll between the main forms records.

The Database I made has contact information at the top of the form and each new record of the main form is for a new contact. Example: Record 1 is for ABC Company. Record Two is for DEF Company. The Subform I'm trying to make would allow me type in phone calls, etc. for each company. For example, for ABC Company, I'd like to put one record on the subform if they called me yesterday and how I resolved the question. Then I'd like to create a second record for ABC company tomorrow if they call me tomorrow and be able to scroll through the records. If I leave ABC Company's record and go to DEF Company's record, then I lose the data I typed into Record 2 and 3, etc. for ABC Company. The same goes for if I type in Record 2 and Record 3 into DEF Company's record, then I lose the data I typed into Record 2 and 3 if I go back to ABC Company's record. This has been so frustrating. I'd love this to work so I can log all of my phone calls for each company I work with.

Any advice or help would be greatly appreciated! I'm still learning and don't know a lot about the parent/child relationships or how to fix this, but I'm a quick learner and any advice would be helpful!

Thank you!

Marissa
 
If you use the Wizard to create you your SubForm you need to ensure that you either accept the suggested linking criteria;
attachment.php


Or select your own linking criteria;
attachment.php


If you don't use the wizard or failed to create the link between Master and SubForm, you can do it manually by selecting the subform holder see the highlighted frame around the subform;
attachment.php

and from there define the Linking fields, see the highlighted areas on the property sheet.
 

Attachments

  • Link1.PNG
    Link1.PNG
    42.3 KB · Views: 1,005
  • Link2.PNG
    Link2.PNG
    43.5 KB · Views: 920
  • Link3.PNG
    Link3.PNG
    50.2 KB · Views: 915
A set of records in a subform is actually a subset of records that relate to the current record in the main form..

Be sure you have the following relationship established as follows - -

The Main form is collecting data to a main table.

The subform is collecting data to a sub table.

You need a primary key in the main table, say it is NUMBER.

NUMBER must also appear in the sub table with the same data type, autonumber, number, text, etc.

You must construct a relationship line between the two NUMBERS in each table. The type is many to one and enforce referential integrity.

Your reference line on the relationship screen will show a single line end at the main table end and a infinity symbol at the sub table end, indicating for each record in the main table (form), there can be many records in the sub table ( sub form) that go with it.

bob
 

Users who are viewing this thread

Back
Top Bottom