Stuart McLachlan
stuart at lexacorp.com.pg
Mon Jan 23 16:03:32 CST 2006
On 23 Jan 2006 at 13:59, Boyd, Mark Thomas (US - Phila wrote: > I have the need to use a Tree View control on a form. > Basically, I have a continuous form, with a number of records containing > Account #'s. I want the user to be able to click a tree node "+" button, > and have detail records for this Account # displayed below. Within this > detail data, the user will need to update specific fields (combo boxes and > checkboxes). > > Is the Microsoft Tree View control capable of this? If not, are there > other controls that have this capability? > Any sample code would be greatly appreciated. > If you need to update child records, I would not try to use a treeview, I would use linked forms Depending on the visual requirements you can do either of the following: 1. A continuous form (frmsubDetails) in the form_footer of your Accounts form with its parent set to the key field in the main form. 2. An unbound main form with two sub forms side by side. A continous subform (frmsubAccounts) on the left which lists all of the accounts. A hidden text box (txtAccountLink) with a control source of "=frmSubAccounts.Key" A continuous subform (frmsubDetails) on the right containing the detail records. Set the Parent Field of frmsubDetails to "txtAccountLink" In either case, when you click on an Account record, the appropriate records will be displayed in frmsubDetails and can be edited. -- Stuart