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

Linking subform to unbound control

Status
Not open for further replies.

keithgi

Technical User
Feb 1, 2002
20
GB
I am a newbie and getting slightly bewildered. I've set up a small database for our office and have a main form in which users can enter search criteria in text boxes which then uses a select statement (based/copied from MS Solutions) to show results in a subform. I want to be able to then click on a record in the subform dataset and have a second subform show a list of related records from a related table. I cannot set link master/child fields as it keeps saying 'cannot link unbound objects'. I presume this is because none of the text boxes are bound directly to a table. I have created an invisible box which shows the ID/Ref of the selected record, and need to use this to find the related info for the second subform.

How do I do this please. The simpler the explanation the better thanks! Your help will be greatly appreciated as this is a big stumbling block for me.
 
Instead of using another subform, you could place a command button on your form that references the ID/Ref in you invisible box and opens a new form with the corresponding records.

When you place a new command button on a form it should automatically start the Wizard. The wizard will walk you through the process.

Let me know if this makes sense.
 
Thanks for the response.
I think I need it to be a bit more automatic than that, since most users will be only using the form to get the information in this second subform. I did think about a command button at the end of each record in the first subform but couldn't do that when my subform is in datasheet view.

Is it possible to use an 'on_click' event in the first subform to trigger the updating of the second subform based on the ID in the invisible box. I think I might have almost answered my own question here! but will still struggle to get the code right!

Thanks if you can help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top