Discussion Locked

Access 2000 SubForms - More Specific

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have two databases where I need subforms in a working form. The first subform will be dependant on the the main form. The second will subform will be dependant on the first subform, the third subform will be dependant on the second and so forth. I've only been able to get the form to work with two subforms. When I added the third subform I'm 99% sure I programmed the parent and child properties correctly but got an error message that I could not assign a value to the object. My question is, can I have more than two subforms, one dependant on the other and if so, how do I program it? I hope this is understandable...

I asked earlier so if you answer the first and the second and I will assign the points from both...

8 replies

by donq

There can be as many a 7 sub-forms nested within a parent Form Rosie however there won't be much room left to display data once you crate that mess. Wouldn't it be a better idea to create a single tab control filling much of the screen and placing the applicable fields under each tab?

If you MUST cascade you sub-forms each must first be creates as though it were a parent, or main form. You will need to begin construction at the lowest level and work your way out.

If possible begin your query in phase 1 to insure everything is produced as expected AND can be edited if necessary. As each parent then becomes sub to a larger parent rework the query to include a new "link" with the fields needed from the new parent. Just make sure therecordset always produces Many Sise data sso the recordset you produce is a Dynaset.

Good Luck Again, Don Quigg

by bob sellman

If you are building a form that might be something like a main form with 6 tabs and each tab uses a subform, where each tab is progressively more detail dependent upon the previous tabs, try using queries to control the subforms rather than the links.

By using this approach you only need to reference values on one subform level. You can also, if necessary, make various tabs not visible until appropriate data is entered into the "earlier" tabs. Set the initial visible property of most tabs to false when the form opens. For the on current property of the form, change each tab to visible only if a value exists for the needed control on the appropriate tab(s).

No linking would be set between any subform (except the tab1 form) and the main form, since each subform (except perhaps tab1) would be based on a query that references the appropriate value(s) on the main form and any subforms.

Remember to requery or recalc a subform when a needed value is updated on each (sub)form (andset the tabs' visible property to true or false as appropriate).

You may have to do other requeries if each tab subform might have multiple records and the records displayed on "later" subforms will change when a different record is highlighted.
Another approach to solving the problem is to have the "cascading" subforms actually come up as a separate form in its own window. That requires more control over display properties and not permitting the user to close the main form without closing the subforms, but certainly can be a simpler (and possibly more effective) solution.

by fofa

If all you are trying to do is Link forms together, you don't really need a subform to do that. You can set filters on a Form Open and use data out of the current record to create the filter.

This discussion is closed to new replies.