I have a main form that has data about a parent. The associated subform has telephone number data related to that parent (home, business, fax etc.) The form is used to display and update already existing parents and telephones and also to add new parents and telephone numbers.
There are three underlying tables. Person table. Telephone table. Person to telephone table (to resolve the one to many relationships). One person can have many telephone numbers. One telephone number can belong to many people (this is a parent database for a school).
I created my subform separately from the main form but added it into the main form using the subform button on the form toolbar and linked the two form via parentid.
When I use the record selector button to forward to a new parent I assumed the subform would also automatically update to pull the telephone data for the new parent. When that didn't happen I added a requery of the subform in the On Current event of the main form. That didn't help either. Then I udpated the SQL statement for the subform so it basically reads:
Select field1, field2, etc.
from tblparent, tblparenttelephone, tbltelephone
where tblparent.parid = tblparenttelephone.parid and
tbltelephone.telid = tblparenttelephone.telid and
tblparent.parid = forms!mainform.parid
When I did that the subform was updated fine, but then I ended up with a new problem. Access said the subform values were not updateable and I could no longer add any phone numbers to the phone number subform. It became basically a display only subform.
I could use a pop-up form to add the phone numbers, but it seems that there should be an easy solution to this problem that I'm just not seeing.
Any help would be greatly appreciated.
There are three underlying tables. Person table. Telephone table. Person to telephone table (to resolve the one to many relationships). One person can have many telephone numbers. One telephone number can belong to many people (this is a parent database for a school).
I created my subform separately from the main form but added it into the main form using the subform button on the form toolbar and linked the two form via parentid.
When I use the record selector button to forward to a new parent I assumed the subform would also automatically update to pull the telephone data for the new parent. When that didn't happen I added a requery of the subform in the On Current event of the main form. That didn't help either. Then I udpated the SQL statement for the subform so it basically reads:
Select field1, field2, etc.
from tblparent, tblparenttelephone, tbltelephone
where tblparent.parid = tblparenttelephone.parid and
tbltelephone.telid = tblparenttelephone.telid and
tblparent.parid = forms!mainform.parid
When I did that the subform was updated fine, but then I ended up with a new problem. Access said the subform values were not updateable and I could no longer add any phone numbers to the phone number subform. It became basically a display only subform.
I could use a pop-up form to add the phone numbers, but it seems that there should be an easy solution to this problem that I'm just not seeing.
Any help would be greatly appreciated.