Subform child/master link question

  • Thread starter ryan.fitzpatrick3
  • Start date
R

ryan.fitzpatrick3

I have a main form which has a subform on it. in the table of the main
form I have

ComponentID --key
item#
itemDesc
supplier#
suppliername

and in the subform I have

HistID -- key
componentID
item#
components
%ofComp
Price

The main form and sub form are a one-to-many relationship.

I linked the master and child links from the sub form to the main form
by the componentID, also, you can correct me if I'm wrong, I also have
item# as well in master and child links, because I want the item#,
once populated in the main form, to populate in the sub form table. I
enter in new information and when I tab over so it creates a new
record below the first entry it won't let me enter in an item, because
the bottom left says calculating. There is no error message. 1) What
is it calculating 2) why is it doing this. I know this will beg some
questions.

Before I had only linked it through the componentID and entering in
multiple components (or entries) worked fine, but in the table the
item# from the main table didn't go into the item# in the subtable. I
need the item# to populate into the sub form table because eventually
i'll need to run a query that'll generate a report. It's only when I
linked componentID and item# in the master/child links where this
occurred, so it makes me wonder what could it be. If this is not
correct how can I get the item# to populate into the subtable when I
create a new record on the main form? Thanks in advance.

Ryan
 
B

Beetle

You should not need to store Item# in the child table. If you need it to
display
on a report then you create a multi-table query that shows the item# based
on the
componentID (along with whatever else you need to show on your report),
and then base your report on that query.

A couple of other thoughts:

1) In your main table you should not store a supplier name, just the
supplierID as a foreign key to a suppliers table.

2) If %ofComp is a calculated field, that also would not normally be stored
in your table. There are occasionally exceptions to that rule, but in most
cases you should not store calculated results in a table. They should be
done in queries / forms / reports.
 
R

ryan.fitzpatrick3

Thank you for your response. As to 1) I'll take out supplier name and
put in supplierID and 2) the %ofcomp is not calculated it would be the
percentage that component that takes up the whole item which was on
the main form. i.e.

main form

item #100001 Cookie

subform

cookie components

Components %ofComp
sugar 22
flour 36
salt 7
oil 18
love 17
 

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