Independent Subform

N

Nicole

I've embedded a sub-form into a main form by dragging it from the forms list
into the main form. I want there to be one sub-form record per main form
record (a one to many relationship, with the sub-form having many fields).
However, when I browse through the records on the main form, the sub-form
still remains on the same record. I've tried to adjust the relationships as
follows. Table = Status Report, Related Table = Design Phase, Primary Keys
for both are Report No. I've chosen to Enforce Referential Integrity. With
these settings the Relationship Type is set for me to "One-to-One
(External)." I don't really understand what I need to do to achieve what all
the Help states should be happening automatically anyway.

Nicole
 
K

Klatuu

You need to set the Link Master Fields and Link Child Fields properties of
the subform control to the names of your relating fields in the two tables.
 
G

George Nicholson

You need to set some properties of the subform control to "connect" the 2
forms. Usually Access does this automatically, but it doesn't always
succeed. Maybe the wizard was on a break.

When you did the drag & drop of the form, Access automatically created a
control to contain your subform. It probably gave the control the same name
as the subform.

In form design, click & select the control containing the subform. It can be
tricky to get the container, and not the form inside it, selected. You'll
know you have it when the caption of the Properties window starts with
"Subform/Subreport" rather than "Form", "Detail", etc. The selected object
will also have the properties LinkChildFields and LinkMasterFields.

Set the LinkChildFields and LinkMasterFields properties of the subform
control to [Report No]. This will filter the subform (Child) recordset to
only those record(s) with the same ReportNo as the Parent form (Master)
ReportNo whenever a change occurs.


HTH,
 
N

Nicole

Klatuu:

I'm doing the happy dance right now because I see the changes taking effect.
However, now I'm getting some behavior that I don't understand. I'm sure it
relates to the fact that my records are sorted alphabetically by project
manager after they're entered. Here's what going on: When trying to to
choose an item from the first combo box, I get the error message "You can't
assign a value to this object." This message doesn't come back again when I
try the second time. Next, the first record in my sub form was given the
report number 11 (by Access, not by me). I then advanced one record in the
main form to see if it would stick, and the sub form record I'd just
completed went to go be with report number 11 from the main form. I guess
this is what I want anyway, therefore I'm not sure if this is erratic
behavior or not.

Nicole
 
N

Nicole

George:

I'm doing the happy dance right now because I see the changes taking effect.
However, now I'm getting some behavior that I don't understand. I'm sure it
relates to the fact that my records are sorted alphabetically by project
manager after they're entered. Here's what's going on: When trying to to
choose an item from the first combo box, I get the error message "You can't
assign a value to this object." This message doesn't come back again when I
try the second time. Next, the first record in my sub form was given the
report number 11 (by Access, not by me). I then advanced one record in the
main form to see if it would stick, and the sub form record I'd just
completed went to go be with report number 11 from the main form. I guess
this is what I want anyway, therefore I'm not sure if this is erratic
behavior or not. What happened to Reports 1-10?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top