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!

1 form with 2 subforms -- Need help ! 2

Status
Not open for further replies.

budich

Programmer
Oct 7, 2000
79
ID
Hi Guys,

I have 1 form with 2 subforms, the main form link with first subform with 1 keyfield say BATCH_ID (ONE TO MANY RELATIONSHIP).
The second subform have link with the first subform with 1 key field say DETAIL_ID ( i HAVE ONE TO MANY RELATIONSHIP IN FIRST SUBFORM AND SECOND SUBFORM).
My problem are :
1. the second subform doesn't give the correct link.
2. the detail_ID in second subform always filled by batch_ID not detail_ID as I mentioned.

Does anyone can help me how I link second subform to first subform ?
Is there any rule or important link for my case ?
Thank you in advance
 
The link field in a subform is called the 'child field'. The field it's linked to on the form it's embedded into is called the 'parent field'. So you always have a parent form/child from with a link created from the parent field you specify to the child field you specify.

If you use the wizard to insert a subform, there is a page where it tells you what it's going to set up as linking fields between the parent form and child form, and gives you the chance to specify different fields to link on if you want to. It sounds like you need to specify different fields.

One option would be to delete the subform that's not linking correctly and reinsert, paying attention to choose your own link at the appropriate spot in the wizard. But you can also edit the link after the subform is inserted. To do that just select the subform on the parent form's design view, and check the data properties. There you will see settings for parent link fields and child link fields. Change those to the fields that you want to be linked.

Couldn't tell from your post, but technically you may want only a single subform inserted onto your main form, with a second level subform inserted into that subform. If you're not inserting the second subtable onto the first subform, and it needs to link to a field in the first subform, then you'll have problems. -- Herb
 
Thank's alot Hsitz,

Yes, Ideally one main form only link with one subform. However what I require is link the subform to another detail subform.
Let's me make clear :
I have main form and first subform basically for entry a Document of Repair Requisition some of rental equipment. Say in mainform is 1 Repair ID and in the first subform link with repair ID and consist of 6 equipments to be repair.
Every equipment has own repair, say 1st equipment has 2 type of repair, the 2nd equipment has 5 type of repair etc.
So, actually I have 3 table that should be entered. 1st and 2nd table is the Repair requisition and the 3rd table is the damage detail which is link only with 2nd table.
Do you have any suggestion to make forms for those 3 table ?
 
Put the 3rd table into a subform in the second table's subform.

You do not want to have two separate subforms on the main form. The damage detail list should be a subform on the subform of the main form. You will end up with a main form containing a subform that itself contains another subform. This is nesting of subforms two levels deep.

If the main form's subform is a datasheet, you will not be able to insert another subform into it. You will have to convert it to a form in continous form view, and then you will have to insert the damage detail subform into the footer of the second form, since you can't insert a subform into the detail section of a continuous view form. -- Herb
 
Thank you Herb,

I have tried your suggestion put the 3rd subform inside the 2nd subform. But the damage ID why shows the wrong number, it follows the repair ID. I have checked the child field but cannot see the solution.
I will try again your suggestion.
May be someone has another solution ? basically I need to fill and link those 3 table or form in one screen.
thank you
 
budich -- If you know the names of the fields that should be linking between the second table and the third table, all you need to do is edit the parent and child fields for the third table's subform control that is located on the second table's subform. You can set the parent and child fields to whatever you want. Of course, if you set them incorrectly, things won't work.

If you want me to take a look at it and fix it, you can email me your .mdb at hsitz@nwlink.com . If you can't set the link fields correctly, then it's possible your tables aren't set up right. -- Herb
 
Yes, I emailed to you.
Thank's a million
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top