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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabbed form nested 3 deep

Status
Not open for further replies.

WantToKnowMore

Programmer
Apr 6, 2004
31
US
Hello all,

I'd like to have a tabbed form to show customers on one tab, orders for a selected customer on the next tab, and order details items for the selected order on a third tab.

Setting up the first two tabs was easy; I dragged the continuous form onto the tab and linked the Master and Child fields. However, the third tab, where I dragged the order details onto the tab, the Master list contained the Customers fields and not the order info so I could link to the order details. Is there a way to reference the order fields so I can link my detail items?

Can this be done?
 
yes. There are several ways. I do the following

put a hidden field on your main form, call it "txtBxLink". On the "oncurrent" event of your "orders" subform put the code
me.parent.txtBxLink = yourCustomerIDfield

Now you can link your third subform to this textbox

Master: [txtBxLink}
child: [orderIDforeignKey]

Also you can set the link directly on your third subform to the control on your second sub form. To see this, look at Northwind. It is demonstrated in there.
 
Hi - thanks for the help - but I did what you said above and I can see the txtBxLink ID field changing as I click the different orders. However when I try to link my subform to the text box, it doesn't show in the pull-down list. I am assuming since it isn't a field on the table of the main form, its not there.

How do you get txtBxLink to show in the list, or do you manually key something in and it accepts it?
 
you can not do it with the wizard you have to type it in manually in the subform control.

link Child Field: [yourForeingKey]
link Master Field: [txtBxLink]

Sometimes it tells you it can not be done. So pick from the list, then manually edit.
 
I totally forgot about the wizard being on!! Thanks so much, it works wonderfully! Now I am going to add another layer then I'll be done. I really appreciate your help, you made it very easy for me to understand.
 
This technique can allow you to do continous synchronized subforms on a main form. Or a continous form with a detail form. So if you had the real estate you could have a continous customer form, synched to a continous order form, synched to a single form order details.

If you clicked on a customer, the second form would show only orders for that customer. Then you could click on any order, and see the details for that order.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top