I have 2 tables with a one-to-many relationship
tblArea(One) to tblPlaces(Many).
tblAreas has 2 fields - Name and Area - Name is a primary key and several names may be in one area
tblPlaces has 2 fields - Name and Comments - the same Name may exist many times with different comments
I can open tblAreas, open the related tblPlaces and type in any number of Comments for any Name.
So far this simplified database works perfectly.
Using the wizard, I create a form based on tblAreas with a subform based on tblPlaces. In the main form the Name and Area are displayed. In the subform the Name and Comments are displayed. On an empty record, the Name field on the subform displays "frmAreas" and the Access add record "*" is greyed out. When I try to add data to the Comments field in the subform, the following error is reported "This property is read-only and can't be set". Click OK, the message disappears and the field becomes writable. The Name field still shows "frmAreas". If the Name field in the subform is not filled in the same as the Name in the main form, the record is not saved. Manually typing in the Name works. Trying to use code to update the subform Name field does not seem to work eg Me.Name = Forms!frmAreas!Name
I am at a total loss. Obviously the Name in both tables must be the same for each record. There must be something very basic that I'm missing.
Nigel.
tblArea(One) to tblPlaces(Many).
tblAreas has 2 fields - Name and Area - Name is a primary key and several names may be in one area
tblPlaces has 2 fields - Name and Comments - the same Name may exist many times with different comments
I can open tblAreas, open the related tblPlaces and type in any number of Comments for any Name.
So far this simplified database works perfectly.
Using the wizard, I create a form based on tblAreas with a subform based on tblPlaces. In the main form the Name and Area are displayed. In the subform the Name and Comments are displayed. On an empty record, the Name field on the subform displays "frmAreas" and the Access add record "*" is greyed out. When I try to add data to the Comments field in the subform, the following error is reported "This property is read-only and can't be set". Click OK, the message disappears and the field becomes writable. The Name field still shows "frmAreas". If the Name field in the subform is not filled in the same as the Name in the main form, the record is not saved. Manually typing in the Name works. Trying to use code to update the subform Name field does not seem to work eg Me.Name = Forms!frmAreas!Name
I am at a total loss. Obviously the Name in both tables must be the same for each record. There must be something very basic that I'm missing.
Nigel.