Katie said:
Here is the SQL from my query. This is the query I use for my Main
form.
SELECT Variable.VarID, Variable.VarName, Variable.VarDesc, LRU.LRUID,
LruType.LruTypeId, LRU.Instance, LRU.InstanceDesc, LRU.ComponentID,
LRU.Zone, LRU.Seat, LruType.ShortDesc, LruType.LongDesc,
LruType.AtaChapterId, LruType.OEMPN, EqValues.EQID, EqValues.VarID
FROM Variable INNER JOIN (((LruType INNER JOIN LRU ON
LruType.LruTypeId=LRU.LRUTypeID) INNER JOIN Equation ON
LRU.LRUID=Equation.LRUID) INNER JOIN EqValues ON
Equation.EQID=EqValues.EQID) ON Variable.VarID=EqValues.VarID
WHERE (((Variable.VarDesc) Like "*ACPDE*" Or (Variable.VarDesc) Like
"*DCPDE*"));
The main form is a query made up of the following tables: Variable,
LRU, LRU Type, Equation, and EqValues. The query pulls all LRUIDs
that have a Variable Description of ACPDE or DCPDE.
My subform is linking to the main form by LRUID and EqValues.VarID.
I want to list all VARID's for each LRUID in my subform. Right now,
it's showing one VARID for each LRU.
The subform is made up of the EqValues and Equation tables. I need
to be able to update the VarID in the EqValues table in the subform.
I only need the Equation table to link the subform back to the main
form but am not updating any records in that table.
So then, all this you've been saying about Companies, Publications, and
the state of California has been just your own made-up example. In the
future, please don't do that -- it only confuses matters.
You haven't posted the table definitions as I asked, so I can only guess
at what relationships you're trying to model here. It would help if you
posted the table definitions and the relationships between them.
It appears to me that you have linked at least one too many table into
the main form's query, and probably more than one -- that would be why
you are getting more records in the main form than you think you should.
If the subform is based on a query joining Equations and EqValues, then
it makes no sense to include those tables in the main form's
recordsource query, since you're going to show them in the subform.
It also looks to me like you should not be linking the subform to the
main form by both LRUID and VarID. That would force the subform to only
ever show at most one VarID. Instead, the subform should be linked by
LRUID alone, so that all the VarIDs for that LRUID will appear on the
subform. If I was right in my conclusions above, you'll be removing
VarID from the main form anyway.
Those changes ought to improve matters.