Tab Control with Subforms / "Can't build a link between unbound forms" error (1 Viewer)

rgreene

Registered User.
Local time
Today, 04:29
Joined
Jan 22, 2002
Messages
168
Tab Control with Subforms / "Can't build a link between unbound forms" error

I am trying to create a database for a cub scout pack that just keeps scouts information, medical info, parents info, and parents medical info each is a seperate table. I have created a Tab controlled form with 4 tabs. On each tab the ONLY thing I have is a subform that contains the appropriate information. Each table has it's own form with the table as it's record source. I link the scouts table to the medical table by SID which is a primary key in the Scouts table. I link the Scouts table to the Parents table with a PID which is the Primary Key in my Parents table, and I link the Parents with the ParentsMed with a PMedID, key in the ParentsMed table.

Question #1 - Using a Tab Control you can only have 1 record source. What should I use? I have tried the tblScouts and I have also created a query with every field from every table.

#2 - When I try to use the parent and child links on the subform I get the error "Can't build a link between unbound forms" but each form is bound to the table and the record source on the tab control has had a table and my qryEverything, neither work. I can type in SID but it still doesn't function properly.

Any suggestions or comments on a better relationship method or any insight on how tab controls are supposed to be setup or anything would be greatly appreciated.

Thanks a lot

Rick
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:29
Joined
Feb 28, 2001
Messages
27,374
Using a Tab Control you can only have 1 record source.

Well, technically not true in this sense: The TAB is just part of a parent form. One form, one recordsource, so there you are quite correct. However, the 2nd recordsource COULD be for a sub-form on that tab. Further, there are more recordsources between heaven and earth than in your imagination, Horatio... (See below)

When I try to use the parent and child links on the subform ...

The parent form's recordsource must be designed to contain everything needed to link to every sub-form's recordsource. You say it is a query, which is perfectly legal. If you have four possible linking fields, the parent form's recordsource must include each one even if the field is not actually visible on the parent form.

If the recordsource you are using doesn't have everything you need for linkage to the child forms, it is quite possible that you have a normalization error of sorts. That would occur if there is a form (as a child) that doesn't depend on data available on its parent. (Hence "unbound" situations.) This is not as serious as a table with a many-to-one relationship and a missing field for the "one" side of the relation. But in a "purist" sense, this would be unnormalized. "Unbound" is the way Access tells you that something is missing from what it expects to see on the form or in its recordsource.

Can you insert the sub-forms with the query wizard enabled? It would do the "legwork" of checking for valid fields and other conditions for you.
 

rgreene

Registered User.
Local time
Today, 04:29
Joined
Jan 22, 2002
Messages
168
I'm not sure what you mean by..Can you insert the sub-forms with the query wizard enabled?
 
Last edited:

rgreene

Registered User.
Local time
Today, 04:29
Joined
Jan 22, 2002
Messages
168
I suold let you know at this point it's written in access 97
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:29
Joined
Feb 28, 2001
Messages
27,374
ac97 has a sub-form wizard. I've used it many times. It allows you to link parent-child forms even on fields that don't have the same names.

When you create a form that is intended to be a master or parent form from which other things will be derived, the other things can include a form that is dependent on the master form. This is a child form. A child form is placed on a form by creating a sub-form control. You should have already built a form to act as the child form, since a sub-form is inherently just a place-holder for another form. When you place the sub-form on your tab, if the wizard button is enabled, you should get a dialog that asks you about parent-child forms and the fields in each to be used as the link between them (so that they will be synchronized). You can have as many recordsources as you have main form plus child forms. In your case, five sources. One parent, four children based on your description.

Each child form, also from your description, has some field in common with the parent, a different field for each child form. So that would be four tabs, four sub-form controls, four form insertions with the wizard, four sets of linking fields to be connected.

You probably will have to assure that the recordsource of the child forms has a prime key that can be used for linking, or at least (for many-to-one cases), a compound key that includes the field in the parent form's recordsource. I'm pretty sure that Access required that child linkages occur through key fields. In which case a relationship between the recordsources would be convenient, because the wizard can detect that and sometimes not bother to ask you for the names of the linking fields. Because the relationship would tell the wizard right away.
 

Users who are viewing this thread

Top Bottom