Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form/Subform add record problem

Status
Not open for further replies.

nq

IS-IT--Management
Apr 1, 2002
102
AU
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.
 
How are ya nq . . . . .

Have a look here: Normalizing Tables

Calvin.gif
See Ya! . . . . . .
 
Double check the LinkMasterFields and LinkchildFields properties of the subform.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks guys.
Problem solved.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top