Base Forms - and subforms

I am checking the functionality of sub forms. I have a main table for people and a second table for contacts made with the people. They are linked by the people primary key. For each person there can be a variable number of contacts. The main form shows the people and the subform shows the contacts. Every thing works, if I change the person the corect contact records are shown. However I cannot add new contacts to the subform. I have recreated the data base a number of times and then recreated the form and subforms but I am not able to add new contacts. I presume I must be missing something in the way I set up the form and subform.

Am I right in assuming that I should be able to add new contacts to a person via the sub form?

Regards

Peter Goggin

Hi Peter,

I am checking the functionality of sub forms. I have a main table for
people and a second table for contacts made with the people. They are
linked by the people primary key. For each person there can be a
variable number of contacts. The main form shows the people and the
subform shows the contacts. Every thing works, if I change the person
the corect contact records are shown. However I cannot add new contacts
to the subform. I have recreated the data base a number of times and
then recreated the form and subforms but I am not able to add new
contacts. I presume I must be missing something in the way I set up the
form and subform.

You could add new contacts directly in the table?
Is the primarykey-field of the contacts part of the subform?
Is there any error-dialog appearing?

Am I right in assuming that I should be able to add new contacts to a
person via the sub form?

You are right. You must be able to add new rows in the subform. Subforms
arent constucted for only showing the content.

Regards

Robert

Have you checked the contacts table directly? I wouldn't mind betting
that you *have* been able to add contacts, but they don't have the
people primary key. I think you'll need to do some extra work
manually (ie programming, not literally by hand) to get that to work.

This is based on a distant memory though, so I may be wrong.

Regards
Mark

The data in the two tables, people and contacts are the same as in my Access base. In the Access forms I can add contacts in the contact subform. In the Base forms when I change the person the contacts subform changes to match the person. When I checked the table definitions in Base I found that the primary key could not be made auto if there was data in the table. I deleted all of the data in the contacts table, changed the primary key definition and re-imported data. Now my forms work correctly. One other thing, I found that if the spreadsheet format for date was not YYYY-MM-DD the import failed.

I now have a fully functional database which does all that I require and so can now drop virtualbox, windows XP and OfficeXP from this machine.