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

How do I Refresh Subform2 based on a click in Subform1?

Status
Not open for further replies.

WozFromOz

Programmer
Mar 31, 2001
16
AU
I have a challenge with subforms.

Lets say I have two tables, companies and products.

I want to create a form with two subforms. The form will list the information about the company, subform1 will list products made by that company, and subform2 will list details about each individual product.

What I want to do is be able to click on a product from subform1, and have the details for just that product appear in subform2. I am assuming it would involve a combination of refresh and "like me" but I am not really sure where to start. Anyone have any ideas?

Onya
WozFromOz
 
Since Subform2 depends on what is in Subform1, why not make subform2 a subform of subform1. Now when you choose a record on the main your subforms will change accordingly. If you move to a certain record on your subform, then subform2 will automatically change.

B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
This is the way subforms work in Access. You should be able to build the main form, place a subform container on the botton, and drag and drop a subform to the bottom which will be automatically linked. Access only knows these can be linked in two ways. First, you set the relationships in the tools\relationships menu or, second, it queries you when the wizard pops up.

Steve King Growth follows a healthy professional curiosity
 
Close but no cigar Lonnie, I should have given more information.

Subform1 must be a continuous form to display ALL the products from the relevant company in a list. Continuous forms cannot contain a subform.

I could do it so that subform1 is a single form containing all the product information but then I would have to scroll through records to get to the required product. I would rather just click on a product from a list in subform1 and then get the information in subform2.

This one is still puzzling me.

Onya
WozFromOz
 
Just thought I would *bump* this into view again 'cos, as I say "This one is still puzzling me."

Anyone got any ideas?? Any help would be greatly appreciated..

Onya
WozFromOz
 
Sounds like a situation where nested subforms would be appropriate. The product detail subform would be contained inside a subform container on the product subform. The Product subform would be contained inside a subform container on the company form.

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top