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!

Subform records not updating when selecting next record on mainform

Status
Not open for further replies.

mas5

Programmer
Dec 15, 2002
98
US
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.
 
I've further localized this problem. I'll start another thread as the problem is more obscure than what I've written above.
 
please post a link to the thread

i am interested in something similiar.

LikeThisName <- ? Sorry It's Taken =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top