Linking Mainform and subforms

T

Tito

Im a new user, Ive designed tables and several subforms. In the mainform, I
have four tabs but they are separate source table.the first tab is the main
form source employer profile, the second tab until the fourth tabs are
subforms to allow multiple entries. The mainform and subforms are supposed to
be linked by a field companyname. My problem is that whenever i go to the
second tab and the rest, Im encountering problems with the companyname, as I
have to input them once again. Is there a dropdowm menu I could use so I
could avoid mistake in typing and cumbersome tasks.
 
A

Allen Browne

Open the form in design view.

Right-click the edge of your subform control, and choose Properties.
On the Data tab, the Link Master Fields should be set to CompanyName, and
Link Child Fields should be set to the matching field in the subform
(possibly also called CompanyName.)

Once you have the linking right, you don't have to show the company name in
the subform (i.e. you can set its Visible property to No if you wish.) It
will automatically inherit the CompanyName from the main form.

Well it will, unless the CompanyName is blank on the main form (e.g. if the
main form is at a new record.)
 
T

Tito

thanks. in a way it works, but a new problem arises, company1 should have
records for company1...and so on.. The subform for previous record did not
changed at all. why? it appears that when I enter a new record for company2
the records of company1 still appears in the subform. It should be a new
record for company2 in the subform. im using MS 2003.

I could have solve this problem if i have just one single table, but im
maintaining several tables for my subforms since my subform has multiple
entries or a worksheet.
 
A

Allen Browne

Access automatically loads the right records into the subform to match the
company in the main form.

If that is not happening, then you do not have the
LinkMasterFields/LinkChildFields properties set up correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top